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
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 = bindWatch | |
function bindWatch (obs, handler) { | |
if (typeof handler === 'function') { | |
return obs(handler.bind(obs)) | |
} else if (handler instanceof Object) { | |
var removeListeners = Object.keys(handler).map(watchKey, { | |
obs: obs, | |
handlers: handler | |
}) |
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 ArrayGrid = require('array-grid') | |
var deepEqual = require('deep-equal') | |
var unwrap = require('./unwrap') | |
module.exports = createLoop | |
function createLoop (frames, startTime, loopLength) { | |
if (frames.length) { | |
var shape = frames[frames.length - 1].value.shape | |
var length = shape[0] * shape[1] |
NewerOlder