This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
var mkdirp = require('mkdirp') | |
var path = require('path') | |
var HOME = process.env.HOME | |
var dir = path.join(HOME, 'dprk.db') | |
mkdirp.sync(dir) | |
var db = require('levelup')(dir, {encoding: 'json'}) | |
db.put( | |
'dprk' | |
, { |
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
strict_chain | |
proxy_dns | |
remote_dns_subnet 224 | |
tcp_read_time_out 15000 | |
tcp_connect_time_out 8000 | |
localnet 127.0.0.0/255.0.0.0 | |
quiet_mode | |
[ProxyList] | |
socks5 127.0.0.1 1080 |
I hereby claim:
To claim this, I am signing this object:
for (var i = 0; i < 1024 * 1024; i++) { | |
process.nextTick(function () { Math.sqrt(i) } ) | |
} |
MyView = Backbone.View.extend({ | |
events: { | |
"click #someButton": "doThat", | |
"change #someInput": "changeIt" | |
}, | |
doThat: function(){ ... }, | |
changeIt: function(){ ... } | |
}); |
function runSpecs() { | |
// configure the spec runner | |
var specRunner = new Hilo.SpecRunner({ | |
src: "Hilo", | |
specs: "specs", | |
helpers: "specs/Helpers" | |
}); | |
// Handle any errors in the execution that | |
// were not part of a failing test |
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.
});