Skip to content

Instantly share code, notes, and snippets.

View lazywithclass's full-sized avatar

Alberto Zaccagni lazywithclass

View GitHub Profile
@lazywithclass
lazywithclass / gist:1827987
Created February 14, 2012 16:38
Javascript quiz question 11
(function(foo){
return typeof foo.bar;
})({ foo: { bar: 1 } });
@lazywithclass
lazywithclass / gist:1836327
Created February 15, 2012 14:50
Javascript quiz question 14
with (function(x, undefined) {
}) length;
@lazywithclass
lazywithclass / gist:1836326
Created February 15, 2012 14:50
Javascript quiz question 13
function f(){ return f; }
new f() instanceof f;
@lazywithclass
lazywithclass / gist:1836323
Created February 15, 2012 14:49
Javascript quiz question 12
(function f(){
function f(){ return 1; }
return f();
function f(){ return 2; }
})();
@lazywithclass
lazywithclass / gist:1895348
Created February 23, 2012 22:14
Emacs ECB configuration
(add-to-list 'load-path "~/Dropbox/emacs/ecb")
(setq stack-trace-on-error t)
(require 'ecb)
(ecb-activate)
(set-face-foreground (quote ecb-default-highlight-face) "DimGrey")
(set-face-background (quote ecb-default-highlight-face) "grey70")
@lazywithclass
lazywithclass / gist:1895495
Created February 23, 2012 22:42
Windmove keybindings
;; Shift + Down moves to the buffer below http://www.emacswiki.org/emacs/WindMove
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))
@lazywithclass
lazywithclass / gist:2719514
Created May 17, 2012 15:04
xbindkeys for mplayer and junit
# m:0x40 + c:133 is the → on the keyboard
# mplayer
"echo "pt_step 1" >/tmp/mplayer-fifo"
m:0x40 + c:133 + n
"echo "pause" >/tmp/mplayer-fifo"
m:0x40 + c:133 + c:65
@lazywithclass
lazywithclass / gist:2719554
Created May 17, 2012 15:11
fifo for mplayer
mkfifo /tmp/mplayer-fifo
mplayer -shuffle -slave -input file=/tmp/mplayer-fifo *
@lazywithclass
lazywithclass / gist:3502950
Created August 28, 2012 19:24
Coffeescript range comprehensions
# will print 1 2 3 4
console.log i for i in [1...5]
# will print 1 2 3 4 5
console.log i for i in [1..5]
@lazywithclass
lazywithclass / gist:3503110
Created August 28, 2012 19:31
Coffeescript range comprehensions with negative limit
# will print 1 0 -1
console.log i for i in [1..-1]