-
http://nodejs.org/api/ -- The api docs. Great reference, i recommend the sections on globals, modules, events, streams, http
-
http://nodemanual.org/latest/nodejs_dev_guide/ - Pretty good bottom-up development guide for understanding common patterns and paradigms of the platform
-
http://www.2bs.nl/nodeconf2012/ -- Good slideshow about libuv and the platform architecture of node
-
https://github.com/joyent/node -- Check out the wiki for updates on the state of the overall project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod = require './module' | |
module.exports.drive = () -> | |
mod.doSomething() # returns `/default/path` | |
mod.path = '/something/else' | |
mod.doSomething() # returns `/something/else` | |
module.exports.drive() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
☁ bulk-hogan [upgrade-hogan] npm show hogan | |
npm http GET https://registry.npmjs.org/hogan | |
npm http 304 https://registry.npmjs.org/hogan | |
{ name: 'hogan', | |
description: 'A mustache compiler.', | |
'dist-tags': { latest: '1.0.5-dev' }, | |
versions: '1.0.5-dev', | |
maintainers: 'fractal <[email protected]>', | |
time: { '1.0.5-dev': '2012-01-28T21:44:36.563Z' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ = require('underscore') | |
assert = require('assert') | |
util = require('util') | |
vector = [ | |
{ id: 1, value: 'aaa', parent: null}, | |
{ id: 2, value: 'bbb', parent: null}, | |
{ id: 3, value: 'ccc', parent: 2}, | |
{ id: 4, value: 'ddd', parent: 2}, | |
{ id: 5, value: 'eee', parent: 1}, | |
{ id: 6, value: 'fff', parent: 4}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set guifont=Anonymous_Pro_Bold:h16 | |
macmenu &File.New\ Tab key=<D-T> | |
set guioptions=egmrt | |
color molokai | |
map <D-M-Up> <C-w>k | |
imap <D-M-Up> <Esc> <C-w>k | |
map <D-M-Down> <C-w>j | |
imap <D-M-Down> <Esc> <C-w>j | |
map <D-M-Right> <C-w>l | |
imap <D-M-Right> <Esc> <C-w>l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you're getting this error trying to use ApacheBench on OS X Lion: | |
# Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54) | |
# | |
# You need to download the latest beta version of Apache and rebuild ab. | |
# Here's how (assuming you have homebrew installed). | |
# Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support | |
brew install pcre | |
# Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include this before you start your connection | |
#this will show where your app is triggering mongodb calls | |
# a modification of an ActiveRecord trace call by Stephen Celis | |
module Mongo | |
module Logging | |
def log_operation(name, payload) | |
@logger ||= nil | |
return unless @logger | |
msg = "#{payload[:database]}['#{payload[:collection]}'].#{name}(" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Script to generate PDF cards suitable for planning poker | |
# from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export. | |
# Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/ | |
# Example output: http://img.skitch.com/20100522-d1kkhfu6yub7gpye97ikfuubi2.png | |
require 'rubygems' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def base64_url_decode(str) | |
str = str + "=" * (6 - str.size % 6) unless str.size % 6 == 0 | |
return Base64.decode64(str.tr("-_", "+/")) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: portrait) {#mainNav #economic-development,#mainNav #workforce,#mainNav #downtown-development, #mainNav #business-development, #mainNav #public-policy, #mainNav #partnership-newsroom { | |
padding: 0 4px 0 8px; | |
} } /* iPad Portrait */ | |
@media all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: landscape) { #mainNav #economic-development,#mainNav #workforce,#mainNav #downtown-development, #mainNav #business-development, #mainNav #public-policy, #mainNav #partnership-newsroom { | |
padding: 0 4px 0 8px; | |
} } /* iPad Landscape */ |