Skip to content

Instantly share code, notes, and snippets.

@deniswolf
deniswolf / gist:3874214
Created October 11, 2012 17:43
colors in .gitconfig
[color]
    diff = auto
    status = auto
    branch = auto
function topLevel(){
var i = 1;
console.log('Top level i: ',i);
function innerLevel(){
console.log('Inner level i: ',i);
console.log('... because var i was silently declared in the beginning of scope === function');
var i = 2;
console.log('Inner level i after assigment: ', i);
}
innerLevel()
# On a mac with snow leopard, for nicer terminal colours:
# - Install SIMBL: http://www.culater.net/software/SIMBL/SIMBL.php
# - Download'Terminal-Colours': http://bwaht.net/code/TerminalColours.bundle.zip
# - Place that bundle in ~/Library/Application\ Support/SIMBL/Plugins (create that folder if it doesn't exist)
# - Open Terminal preferences. Go to Settings -> Text -> More
# - Change default colours to your liking.
#
# Here are the colours from Textmate's Monokai theme:
#
@deniswolf
deniswolf / kommunism.js
Last active December 15, 2015 16:19
build on idea of promises POC of framework full of chained callbacks
// kommunism.js
// build on false promises
// to chain callbacks
function PrimitiveKommunism(computationFunction, thisArg){
// todo: return promise that will resolve when computation is done
var someInnerComputationsResult = computationFunction.apply(thisArg, _.toArray(arguments));
function Kommunism(currentCallback, optionalCallbackParameters){
var currentArguments = _.toArray(arguments).slice(1);