Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
/* | |
A shim for non ES5 supporting browsers. | |
Adds function bind to Function prototype, so that you can do partial application. | |
Works even with the nasty thing, where the first word is the opposite of extranet, the second one is the profession of Columbus, and the version number is 9, flipped 180 degrees. | |
*/ | |
Function.prototype.bind = Function.prototype.bind || function(to){ | |
// Make an array of our arguments, starting from second argument | |
var partial = Array.prototype.splice.call(arguments, 1), | |
// We'll need the original function. |
var SomeModel = Backbone.Model.extend({}); | |
someModel = new SomeModel(); | |
someModel.bind("change", function(model, collection){ | |
alert("You set some_attribute to " + model.get('some_attribute')); | |
}); | |
someModel.set({some_attribute: "some value"}); |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
/** | |
* Module dependencies | |
*/ | |
var express = require('express'); | |
var fs = require('fs'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// img path |
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.
o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
/** | |
* testing tasks (using karma to test in the browser). Requires a karma.conf.js for full config | |
* single-run testing | |
* continuous testing | |
*/ | |
/** base deps, but you may need more specifically for your application */ | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var path = require('path'); |
var path = require('path'); | |
var gulp = require('gulp'); | |
var streamqueue = require('streamqueue'); | |
var $gulp = require('gulp-load-plugins')({ | |
lazy: false | |
}); | |
var prependBowerPath = function (package) { | |
return path.join('./src/bower_components/', package); | |
}; |