Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
function add() { | |
var sum = 0; | |
function add() { | |
for (var i=0; i<arguments.length; i++) { | |
sum += Number(arguments[i]); | |
} | |
return add; | |
} | |
add.valueOf = function valueOf(){ |
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.
Getting started:
Related tutorials:
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
#!/usr/bin/env sh | |
set -e | |
# install charles proxy from deb sources. | |
# http://www.charlesproxy.com | |
sudo sh -c 'echo "deb http://www.charlesproxy.com/packages/apt/ charles-proxy main" > /etc/apt/sources.list.d/charles-proxy.list' | |
wget -q http://www.charlesproxy.com/packages/apt/PublicKey -O - | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install -y charles-proxy |
/* Closures and Scoping */ | |
!function(window) { | |
var body = window.getElementsByTagName('body')[0]; | |
console.log(body); | |
}(document); | |
/* | |
Q: What would you expect the value of body to be? |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
var application_root = __dirname, | |
express = require("express"), | |
path = require("path"), | |
mongoose = require('mongoose'); | |
var app = express.createServer(); | |
// database | |
mongoose.connect('mongodb://localhost/ecomm_database'); |