This converter converts between entities.
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 fs = require('fs'); | |
var jsdom = require('jsdom'); | |
function svgToPng (xml, out) { | |
var convert = require('child_process').spawn("convert", ["svg:", "png:-"]); | |
convert.stdout.pipe(out); | |
convert.stdin.write(xml); | |
convert.stdin.end(); | |
} | |
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
if (!Object.__proto__) { | |
var sandbox = function () { | |
// create an <iframe> | |
var iframe = document.createElement("iframe"); | |
iframe.style.display = "none"; | |
document.documentElement.appendChild(iframe); | |
return frames[frames.length - 1]; | |
} | |
var iframe = sandbox(); |
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
// Calls functions once a promise has been delivered. | |
// var p = promise(); | |
// Queue functions: p(yourCallback) | |
// Deliver the promise: promise.deliver([args...]). | |
// Once the promise has been delivered, p(yourCallback) immediately calls the callback. | |
function promise () { | |
var queue = [], args = null; | |
var promise = function (fn) { | |
if (promise.delivered) { |
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
// npm install rem read | |
var rem = require('rem') | |
, read = require('read'); | |
var github = rem.connect('github.com', 3.0) | |
read({ prompt: 'Username: '}, function (err, username) { | |
github('users', username, 'repos').get(function (err, repos) { | |
console.log(repos); | |
}); |
var isNode = typeof process != 'undefined' && process.versions && process.versions.node;
var isBrowser = typeof window != 'undefined';
var isModule = typeof module != 'undefined' && module.exports;
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
// GraphButton source code | |
// Set output port for planner. | |
local output = OutputPort("trigger"); | |
// Callback when the button is pressed. | |
function pin7changed() { | |
local buttonState = hardware.pin7.read(); | |
// If buttonState is 0, the button is pushed. |
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 rem = require('rem'); | |
var api = rem.createClient({ | |
base: 'http://www.startuppack.org/v1/', | |
uploadFormat: 'form' | |
}); | |
api('users').post({ | |
token: ..., // your token | |
email: "[email protected]", |
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
// npm install rem read | |
var rem = require('rem') | |
, fs = require('fs') | |
, read = require('read'); | |
var tw = rem.connect('twitter.com', '1.1') | |
, oauth = rem.oauth(tw); | |
// Add whichever API keys you want to test here. | |
// Including the iPhone/Android apps, these keys are configured as "desktop" |