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 nest = require('depnest') | |
var MutantPullReduce = require('mutant-pull-reduce') | |
exports.needs = nest({ | |
'sbot.pull.stream': 'first' | |
}) | |
exports.gives = nest('bookmarks.obs.all', true) | |
exports.create = function (api) { |
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 mutators = [ | |
'fill', 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift' | |
] | |
function ObservableArray(onChange){ | |
var array = [] | |
array.set = set | |
array.onchange = onChange |
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
ffmpeg -i input.wav -vn -codec:a libmp3lame -qscale:a 2 output.mp3 |
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
# remove broken wifi drivers (makes wifi work after reboot) | |
sudo apt purge bcmwl-kernel-source | |
reboot | |
# to get backlight working, install rEFInd and enable "spoof_osx_version" |
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 execFile = require('child_process').execFile | |
module.exports = function (context, path, start, duration, cb) { | |
var child = execFile('ffmpeg', [ | |
'-i', path, | |
'-ss', start, | |
'-t', duration, | |
'-f', 'wav', | |
'-acodec', 'pcm_s32le', | |
'pipe:1' | |
], { encoding: 'buffer', maxBuffer: 10 * 1024 * 1024 }, function (err, result, stderr) { |
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 watch = require('observ/watch') | |
module.exports = function (tempo, listener) { | |
var pos = null | |
var length = 25 | |
var destroyed = false | |
var releases = [] | |
if (typeof tempo === 'function') { | |
releases.push(watch(tempo, setTempo)) |
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 SerialPort = require('serialport').SerialPort | |
var bl = require('bl') | |
module.exports = connect | |
function connect (device, cb) { | |
var port = new SerialPort(device, { baudrate: 115200, highWaterMark: 1 }) | |
var timer = null | |
var initialized = false | |
var queue = [] |
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 bl = require('bl') | |
var controlFrame = new Buffer([0x00, 0x00, 0x00, 0x00]) | |
module.exports = function (pixels, cb) { | |
var frame = bl() | |
// start frame | |
frame.append(controlFrame) | |
// body frames |
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
module.exports = animate | |
var requestAnimationFrame = | |
global.requestAnimationFrame || | |
global.webkitRequestAnimationFrame || | |
global.mozRequestAnimationFrame || | |
global.msRequestAnimationFrame || | |
global.oRequestAnimationFrame || | |
function(fn, el) { | |
setTimeout(fn, 1000/60) |
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
ssh -R *:1234:localhost:9966 user@server.com | |
# http://server.com:1234 |
NewerOlder