Posterous
Lukasz is using Posterous to post everything online. Shouldn't you?
Picnawode_thumb
 

plugawy blog

vim, coffee, web dev and stuff

11 Oct

Maximize VIM window

Use this little thingie:

(License: you can use this script only for GOOD, never for evil. If
you really must - contact me, we can talk about the price)

Comments [0]

6 Sep

Aptana WRT Plugin Basics - Forum Nokia Wiki

NOTE: If you fail to utilize AJAX calls while debugging or previewing, you can try circumventing the same origin policy in Firefox with the following steps. This is done at your own risk + The call to Privilege manager cannot be executed in a real S60 device or the emulator.

  • Add a netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); call to the function issuing your AJAX requests
  • Type about:config in Firefox address bar and set signed.applets.codebase_principal_support value to true by double-clicking it.
  • Initialize a debugging session and issue an AJAX call => You should now be prompted about giving the script access to whatever domain you are requesting from.

Aptana's WRT plugin doesn't work for me - JS stops executing and all that.
However - the hint on how to bypass Same Origin Policy is something that needs to be saved for later.

Comments [1]

19 Aug

Adobe AIR documentation

What's this? I can see the xxx's all over the place.
Is it a suggestion that I should creat a pr0n app? (Which is quite good idea, because pr0n === money).

Comments [0]

4 Aug

Perfect vim indentation settings

" ~/.vimrc
set smartinden
set autoindent
set noexpandtab
set tabstop=4
set shiftwidth=4    
set softtabstop=4

These settings finally make my vim behave properly.

Comments [0]

31 Jul

Best way to load your JavaScript

via Ajaxian » Front Page by Dion Almaer on 7/30/09

Nicholas Zakas thinks he has the best way to load JavaScript.

Steve Souders has a bunch of best practices, and it seems that there is definitely nuance that makes advice very much tailored to your circumstance.

Nicholas though, has an opinion:

I’ve come to the conclusion that there’s just one best practice for loading JavaScript without blocking:

  1. Create two JavaScript files. The first contains just the code necessary to load JavaScript dynamically, the second contains everything else that’s necessary for the initial level of interactivity on the page.
  2. Include the first JavaScript file with a <script> tag at the bottom of the page, just inside the </body>.
  3. Create a second <script> tag that calls the function to load the second JavaScript file and contains any additional initialization code.

A helper to make this happen could look like:

JAVASCRIPT:
  1.  
  2. function loadScript(url, callback){
  3.  
  4.     var script = document.createElement("script")
  5.     script.type = "text/javascript";
  6.  
  7.     if (script.readyState){  //IE
  8.         script.onreadystatechange = function(){
  9.             if (script.readyState == "loaded" ||
  10.                     script.readyState == "complete"){
  11.                 script.onreadystatechange = null;
  12.                 callback();
  13.             }
  14.         };
  15.     } else {  //Others
  16.         script.onload = function(){
  17.             callback();
  18.         };
  19.     }
  20.  
  21.     script.src = url;
  22.     document.getElementsByTagName("head")[0].appendChild(script);
  23. }
  24.  

In related news, the LABjs folk have updated their API from this:

JAVASCRIPT:
  1.  
  2. $LAB
  3. .script("jquery.js")
  4. .block(function(){
  5.       $LAB
  6.       .script("jquery.ui.js")
  7.       .script("myplugin.jquery.js")
  8.       .block(function(){
  9.             $LAB.script("initpage.js");
  10.       });
  11. });
  12.  

to the simpler:

JAVASCRIPT:
  1.  
  2. $LAB
  3. .script("jquery.js")
  4. .block()
  5. .script("jquery.ui.js")
  6. .script("myplugin.jquery.js")
  7. .block()
  8. .script("initpage.js");
  9.  

I seem to remember that Steve had some opinions on this API too :)

Comments [1]

28 Jul

R programming language

The assignment operator in R is <- as in

e <- m*c^2.

It is also possible, though uncommon, to reverse the arrow and put the receiving variable on the right, as in

m*c^2 -> e.

It is sometimes possible to use = for assignment, though I don't understand when this is and is not allowed. Most people avoid the issue by always using the arrow.

Looks like I’m not going to learn this language.

Sauce:  http://www.johndcook.com/R_language_for_programmers.html

Comments [0]

25 Jul

Up and running

Comments [0]

22 Jul

Coding Horror: Nobody Hates Software More Than Software Developers

When people say "this sucks" they mean one or more of the following:

  • This doesn't do what I need
  • I can't figure out how to do what I need
  • This is unnecessarily frustrating and complex
  • This breaks all the time
  • It's so ugly I want to vomit just so I have something prettier to look at
  • It doesn't map to my understanding of the universe
  • I'm thinking about the tool, instead of my work

This article doesn't suck. If you are a software developer - read it. Now

Comments [0]

17 Jul

single vs double

Benchmarks run against PHP 5.2 and 5.3 show that parsing double-quoted
 
strings with interpolation is no slower (and often faster) than
single- quoted strings using concatenation. When simple strings with no variables in them are used, the performance is clearly better with double-quoted strings due to implementation details in the engine. See
 
the benchmark posted at .
From http://www.reddit.com/tb/8w1mk

Comments [0]

8 Jul

"resource packages" in firefox

Interesting proof of concept – instead of using clunky and hard-to-mantain css sprites firefox users can benefit from archived files. This article explains how it can be used and how it works.

What’s really interesting is this bit:

Hi,

Interesting article. For the past few weeks here at Mozilla, we've been working on a proposal called "resource packages", which are similar to what you are doing here, but with the additional bonus of having a fallback mode for other browsers. I have reached out and met with Steve Souders from Google, and we are contacting the other browser makers once we have the proposal in a bit better state.

You can view an early draft here: http://limi.net/articles/resource-packages

— Alexander Limi · Firefox User Experience

We’ll see happens next.

Comments [0]