Your web-browser is very outdated, and as such, this website may not display properly. Please consider upgrading to a modern, faster and more secure browser. Click here to do so.
Wirify is a bookmarklet for generating a wireframe for the current page. Read more about Wirify in its announcement.
A creative solution that works amazingly well, plus it fits perfectly in a bookmarklet.
9 notes View comments
Very easy way of minimizing a few bytes of every request using Google’s Closure Compiler which is a java program for compressing javascript.
$ curl -0 http://closure-compiler.googlecode.com/files/compiler-latest.zip
$ unzip compiler-latest.zip -d ~/Applications/closure-compiler ; cd ~/Applications/closure-compiler
$ echo "// A simple function.
function hello(longName) {
alert('Hello, ' + longName);
}
hello('New User');" > hello.js
$ java -jar compiler.jar --js hello.js --js_output_file hello-compiled.js
$ cat hello-compiled.js
function hello(a){alert("Hello, "+a)}hello("New User");
$ wc -c hello.js
101 hello.js
$ wc -c hello-compiled.js
56 hello-compiled.js
$ curl -0 http://closure-compiler.googlecode.com/files/compiler-latest.zip
Download the good stuff
$ unzip compiler-latest.zip -d ~/Applications/closure-compiler ; cd ~/Applications/closure-compiler
Locate the executable in a standard location and go there
$ echo "// A simple function.
function hello(longName) {
alert('Hello, ' + longName);
}
hello('New User');" > hello.js
Create a file with valid javascript in it
$ java -jar compiler.jar --js hello.js --js_output_file hello-compiled.js
Use the recently unzipped compiler.jar to take input from hello.js and generate its optimized version at hello-compiled.js. Note that there’s only one file to use, compiler.jar. Usable.
$ cat hello-compiled.js
function hello(a){alert("Hello, "+a)}hello("New User");
Dump the contents of the newly created file, just to verify what a minified javascript file could look like
$ wc -c hello.js
101 hello.js
$ wc -c hello-compiled.js
56 hello-compiled.js
Comparing bytes in each file shows almost 50% winnings, both in terms of lowering the storage needed but also for each request of that file.
View comments
Perfect solution for displaying many markers at the same time in Google Maps.
View comments
Always had an issue with scope and functions like call() and apply() in javascript - until now.
Two easy-to-read sources are:
View comments