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
var require = (function () { | |
var _required = {}; | |
return (function (url, callback) { | |
if (typeof url == 'object') { | |
// we've (hopefully) got an array: time to chain! | |
if (url.length > 1) { | |
// load the nth file as soon as everything up to the n-1th one is done. | |
require(url.slice(0,url.length-1), function () { | |
require(url[url.length-1], callback); | |
}); |
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
from foo import * | |
initialise() | |
print my_var |
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
<html> | |
<head> | |
<title>blah</title> | |
<script src="../socket.io/socket.io.js"></script> | |
<script src="jquery-1.4.4rc2.js"></script> | |
<script src="main.js"></script> | |
<style> | |
canvas#canvas { | |
position: absolute; | |
left: 0; |
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
var assert = require('assert') | |
, path = require('path') | |
function some_helper(foo) { | |
assert.equal(foo, 4) | |
} | |
module.exports = { | |
'test array length': function (test) { | |
some_helper([1,2,3,4].length) |
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
" duh | |
syn on | |
filetype plugin indent on | |
" the only TRUE tab settings | |
set ts=2 sw=2 noet tw=79 ai smarttab | |
" keep 4 lines between the cursor and the edge of the screen where possible | |
set so=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
function! Thing() | |
py << EOF | |
import vim, thread, time | |
def go(): | |
time.sleep(2) | |
vim.current.buffer[0] = "foo" | |
thread.start_new_thread(go, ()) | |
EOF | |
endfunction |
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
test.deepEqual ['x',4], type._transformPath(['x',3], {p:['x',0], li:0}) | |
test.deepEqual ['x',3], type._transformPath(['x',3], {p:['x',5], li:0}) | |
test.deepEqual ['x',3], type._transformPath(['x',3], {p:['x',0,'x'], li:0}) | |
test.deepEqual ['x',3,'x'], type._transformPath(['x',3,'x'], {p:['x',5], li:0}) | |
test.deepEqual ['x',4,'x'], type._transformPath(['x',3,'x'], {p:['x',0], li:0}) |
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
[56 of 58] Compiling Distribution.Simple.Configure ( Distribution/Simple/Configure.hs, dist/build/Distribution/Simple/Configure.o ) | |
[57 of 58] Compiling Distribution.Simple.Install ( Distribution/Simple/Install.hs, dist/build/Distribution/Simple/Install.o ) | |
[58 of 58] Compiling Distribution.Simple ( Distribution/Simple.hs, dist/build/Distribution/Simple.o ) | |
Registering Cabal-1.8.0.6... | |
Installing library in /Users/nornagon/.cabal/lib/Cabal-1.8.0.6/ghc-7.0.3 | |
Registering Cabal-1.8.0.6... | |
<command line>: cannot satisfy -package Cabal-1.10.1.0: | |
Cabal-1.10.1.0-49678efb6bfc399545e2b61629b900e2 is unusable due to missing or recursive dependencies: | |
process-1.0.1.5-107ac5b78a5845608025ca13d328fdc5 | |
(use -v for more information) |
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
obj = sharejs.open('http://foo:3300/', 'doc_name', 'json') | |
obj.on('changed', function (ev) {...}) | |
obj.at().set({}) // initial document | |
foo = obj.at('foo') | |
foo.set([0]) // { p: ['foo'], oi: [0] } | |
foo.push(3) // { p: ['foo', 1], li: 3 } | |
foo.insert(0, ['bar']) // { p: ['foo', 0], li: ['bar'] } | |
foo.get() // => [['bar'],0,3] | |
foo.at(0).push('baz') // { p: ['foo',0,1], li: 'baz' } |
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
var exec = require('child_process').exec | |
function howManyOctets(cb) { | |
child = exec('snmpwalk -v 2c -c admin 192.168.0.1 IF-MIB::ifHCInOctets.1', // change to .32 to measure external usage | |
function (error, stdout, stderr) { | |
var numOctets = 0 | |
stdout.split('\n').forEach(function (line) { | |
numOctets += parseInt(/: (\d+)/.exec(stdout)[1]) | |
}) | |
cb(numOctets) |
OlderNewer