Tired of those horribly slow templating languages?
Want a super fast templating language that doesn't involve strings?
Do you like your libraries small and simple?
Then DO Not Use This
/* | |
A copy of https://gist.github.com/airhadoken/8742d16a2a190a3505a2 | |
See also: https://botwiki.org/bots/twitterbots/emoji__polls/ | |
*/ | |
var T = require("twit"); | |
var Q = require("Q"); | |
// key and secret for Twitter for iPhone. | |
// A whitelisted app is needed to access the cards API; you can't just create your own currently. |
// Here is a function that I use all the time when creating public | |
// async APIs in JavaScript: | |
const resolvePromise = (promise, callback) => { | |
if (callback) | |
promise.then(value => callback(null, value), callback) | |
return promise | |
} | |
// Sometimes I like to use callbacks, but other times a promise is |
#!/usr/bin/env node | |
// todo: try to require jshint here, instead of spawning process, then fallback to spawning process. | |
var jshint = nrequire('jshint'); | |
if (jshint) return process.exit(0); | |
// jshint not installed locally, spawn process instead. | |
// basically the same, but less pretty. | |
var exec = require('child_process').exec; |