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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# portable cronjob wrapper to ensure : | |
# | |
# * only one process at the time (prevents process-overlap, handy for unique cron workers) | |
# * reverse cron's email behaviour (only emails on error) | |
# * ultraportable: only reliest on flock, not on debians 'start-stop-daemon' or centos 'daemon' | |
# * nicelevel to tame cpu usage | |
# | |
# usage: cronjoblock <application> [args] | |
# example: cronjoblock /home/foo/myscript & |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
elem.clientLeft
,elem.clientTop
,elem.clientWidth
,elem.clientHeight
elem.getClientRects()
,elem.getBoundingClientRect()
These rules are adopted from the AngularJS commit conventions.