Skip to content

Instantly share code, notes, and snippets.

@jond3k
jond3k / log4x
Created November 13, 2011 01:57
yay log4x
#!/usr/bin/yay
# Highlights log4j style messages
debug and trace are @boring
info is @normal
warning is @interesting
error is @serious
fatal is @serious
# some words that aren't logger levels but are still important
@jond3k
jond3k / gist:1352258
Created November 9, 2011 17:52
Two ways to crawl objects with an array of 'directions'. re: https://gist.github.com/1351684
var obj = {a:{b:{c:':D'}}};
var path = ['a','b','c'];
var path2 = ['a','b','c'];
console.log(crawl(obj, path));
console.log(crawl2(obj, path2));
function crawl2(obj, keys) {
while(keys.length) {
obj = obj[keys.shift()];
}