Example output, where |
is the cursor:
function () {
|
};
foo(function () {
// Needs a clever name like "debounce" or "throttle" (but it's not either of those.) | |
function doOperationButOnlyReactIfItWasntCalledAgainInBetween(promiseOperation) { | |
var latestOperation = null; | |
return function () { | |
var deferred = Q.defer(); | |
var operation = promiseOperation.apply(this, arguments); | |
latestOperation = operation; | |
operation.then( |
Example output, where |
is the cursor:
function () {
|
};
foo(function () {
namespace('test', function () { | |
desc('Run server tests'); | |
task('server', [], function () { | |
jake.exec('mocha spec', function () { | |
console.log('Server tests passed'); | |
complete(); | |
}); | |
}); | |
desc('Run client tests'); |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
_prompt() { | |
local _prompt=$1 | |
local _out=$2 | |
local _default=$3 | |
local _val='' | |
if [ $_default ]; then | |
_prompt="${_prompt} [${_default}]" | |
fi | |
read -p "$_prompt " _val | |
if [ $_val ]; then |
define( [ 'jquery', 'mods/crazydot' ], function( $, CrazyDot ){ | |
var dots = []; | |
var setup = function( cfg ){ | |
while ( dots.length < cfg.count ){ | |
dots.push( new CrazyDot( cfg.speed, 'body' ).move() ); | |
} | |
}; | |
var stopGame = function(){ |
(function() { | |
var buildMap = {}; | |
/* RequireJS Use Plugin v0.2.0 | |
* Copyright 2012, Tim Branyen (@tbranyen) | |
* use.js may be freely distributed under the MIT license. | |
*/ | |
define({ | |
version: "0.2.0", |
#!/bin/bash | |
LINES=$(tput lines) | |
COLUMNS=$(tput cols) | |
declare -A snowflakes | |
declare -A lastflakes | |
clear |
" .vimrc | |
" Author: Karl Groll <[email protected]> | |
" | |
" Mostly stolen from Steve Losh | |
" (http://stevelosh.com/blog/2010/09/coming-home-to-vim/) | |
" | |
" Preamble ---------------------------------------------------------------- {{{ | |
filetype off | |
call pathogen#runtime_append_all_bundles() " Enable 'Pathogen' plugin. (Vim plugin manager) |
// Basic approach. Does not try to register in | |
// a CommonJS environment since jQuery is not likely | |
// to run in those environments. See next file | |
// if you want to opt in to CommonJS too. | |
(function(factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(['jquery'], factory); | |
} else { |