View alarm
1 2 3 4 5
#!/bin/bash
at "$*"
amixer set Master unmute
amixer set Master 100%
mplayer -vo none $HOME/media/internet/dayvan_cowboy.mp4
View callsites.js
1 2 3 4 5 6 7 8 9 10
var falafel = require('falafel');
var inspect = require('object-inspect');
var fs = require('fs');
var src = fs.readFileSync('fib.js', 'utf8');
 
var id = 0;
var nodes = {};
 
var out = falafel(src, function (node) {
if (node.type === 'FunctionDeclaration'
View gist:24c6dd24e860c7b0e72c
1 2 3 4 5
~ $ time bash -c '(sleep 2 & sleep 3 & sleep 1 & sleep 1; wait)'
 
real 0m3.011s
user 0m0.000s
sys 0m0.004s
View main.js
1 2 3 4 5 6 7 8 9 10
 
buffer.js:343
throw new RangeError('attempt to write beyond buffer bounds');
^
RangeError: attempt to write beyond buffer bounds
at Buffer.write (buffer.js:343:11)
at Object.exports.string.encode (/home/substack/projects/changes-index/node_modules/changesdown/node_modules/protocol-buffers/encodings.js:64:12)
at Object.encode (eval at <anonymous> (/home/substack/projects/changes-index/node_modules/changesdown/node_modules/protocol-buffers/node_modules/generate-function/index.js:55:21), <anonymous>:8:10)
at ChangesDOWN._batch (/home/substack/projects/changes-index/node_modules/changesdown/changesdown.js:104:25)
at AbstractLevelDOWN.batch (/home/substack/projects/changes-index/node_modules/changesdown/node_modules/abstract-leveldown/abstract-leveldown.js:162:17)
View check_adventures.js
1 2 3 4 5 6 7 8 9 10
var fs = require('fs');
var path = require('path');
var perms = require('mode-to-permissions');
 
function check (name, cb) {
var parts = process.env.PATH.split(':');
(function next () {
if (parts.length === 0) return cb(null, false);
var p = parts.shift();
fs.stat(path.join(p, name), function (err, stat) {
View weighted_select.js
1 2 3 4 5 6 7 8 9
var messages = [ 'a', 'b', 'c' ];
var weights = [ 3, 5, 1 ];
 
var n = 0;
for (var i = 0; i < weights.length; i++) {
n += weights[i];
}
 
var r = Math.random(); // between 0 and 1
View float.js
1 2 3 4 5 6 7 8 9 10
var rhythm = [ 1, 8, 2, 1/8, 1, 1/20 ];
var melody = [ 300, 500, 250 ];
 
return function (t) {
var r = rhythm[Math.floor(t*8) % rhythm.length];
var m = melody[Math.floor(t) % melody.length];
return 0
+ tri(4/m * tri(m + tri(r/40/m) + tri(r*16/m)))
* sq(m/8 + m*saw(1/8000)/10)
* tri(m/10 + tri(m/400)/40 * tri(20/m)/m*2000)
View gist:55828148ee37a2b8b867
1 2 3 4 5 6
/home/substack/projects/forkdb/node_modules/tape/index.js:75
throw err
^
OpenError: IO error: lock /tmp/forkdb-test-0.569052709499374/db/LOCK: already held by process
at /home/substack/projects/forkdb/node_modules/fwdb/node_modules/levelup-defaults/node_modules/levelup/lib/levelup.js:118:34
npm ERR! Test failed. See above for more details.
View multifile.html
1 2 3 4 5 6 7 8 9 10
<html>
<body>
<div class="tweet" template="tweet">
<span class="name"></span>:
<span class="message"></span>
</div>
<div class="store" template="store">
<span class="key"></span>:
<span class="value"></span>
</div>
View merge.js
1 2 3 4 5 6 7 8 9
var first = {
a: 3,
b: 5
};
var second = {
c: 5,
d: 6
};
console.log(merge(first, second));
Something went wrong with that request. Please try again.