Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' # map caps to escape | |
| setxkbmap -option ctrl:nocaps #disable caps default functionality | |
| setxkbmap -option grp:alt_shift_toggle us,gr # map alt shift to layout toggle |
| { | |
| "directory": "vendor/assets/components" | |
| } |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # MAC manipulators | |
| alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`' | |
| alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE' |
JavaScript Code
var str = "hi";Memory allocation:
| Address | Value | Description |
|---|---|---|
...... |
... |
| # sudo ln -s ~/nginx.conf unicorn.conf | |
| upstream app_server { | |
| server unix:/tmp/unicorn_padrino.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80; | |
| charset utf-8; | |
| server_name db.innshine.com; |
| /* | |
| * Takes provided URL passed as argument and make screenshots of this page with several viewport sizes. | |
| * These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed | |
| * | |
| * Usage: | |
| * $ casperjs screenshots.js http://example.com | |
| */ | |
| var casper = require("casper").create(); |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| // Require.js allows us to configure shortcut alias | |
| require.config({ | |
| // The shim config allows us to configure dependencies for | |
| // scripts that do not call define() to register a module | |
| shim: { | |
| 'socketio': { | |
| exports: 'io' | |
| }, | |
| 'underscore': { | |
| exports: '_' |
| .DS_Store | |
| tmp/ |