This file contains hidden or 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
default_driver=alsa | |
dev=default |
This file contains hidden or 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 gpio = require("pi-gpio"); | |
gpio.open(11, "input", function(err) { if (err) { console.log(err); }}); | |
setInterval( function() { gpio.read(11, function(err, value) { console.log("value:", value); }); }, 1000); |
This file contains hidden or 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 memwatch = require('memwatch'); | |
var classical = function() { | |
var Apple = function(options) { | |
var self = this; | |
var color = options.color; | |
var getColor = function() { | |
return color; | |
}; |
This file contains hidden or 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 spawn = require('child_process').spawn; | |
var util = require('util'); | |
var commands = { | |
'pause' : 'p', | |
'quit' : 'q', | |
'play' : '.', // TODO: check | |
'forward' : "$'\\x1b\\x5b\\x43'", // TODO: check | |
'backward' : "$'\\x1b\\x5b\\x44'" // TODO: check | |
}; |
This file contains hidden or 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
#!/usr/bin/env node | |
var spawn = require('child_process').spawn; | |
var path = require('path'); | |
var nodeBin = process.execPath; | |
var appjs = path.resolve(__dirname, 'app.js'); | |
var options = { detached: true, stdio: 'ignore', cwd: __dirname }; | |
var child = spawn(nodeBin, [appjs], options); | |
child.unref(); |
This file contains hidden or 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 EventEmitter = require('events').EventEmitter; | |
var a = Object.create(EventEmitter.prototype); | |
a.on('x', function() { console.log("x!"); }); | |
a.emit("x"); |
This file contains hidden or 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 fs = require('fs'); | |
var path = require('path'); | |
var walk = function(dir, done) { | |
var results = {}; | |
fs.readdir(dir, function(err, list) { | |
if (err) { | |
return done(err); | |
} | |
var i = 0; |
This file contains hidden or 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
To make the black pixels transparent and keeps the white pixels as they are, run this command: | |
convert source.png -alpha copy -fx '#fff' result.png |
This file contains hidden or 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
#!/usr/bin/env ruby | |
## first parameter is the row number from pascal triangle | |
def triangle(n) | |
ret = [] | |
(0..n).each{|r| | |
lst=[1] | |
term=1 | |
k=1 |
This file contains hidden or 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: skip frames | |
-vf select="gte(n\, 5)" |