Skip to content

Instantly share code, notes, and snippets.

View jonsullivan's full-sized avatar

Jon Sullivan jonsullivan

View GitHub Profile
var hyperquest = require('hyperquest');
module.exports = function downloadUtf8FileIntoString(url, cb) {
if (!url) return cb(new Error('url is required'));
var result = ''; // fixed scope
hyperquest(url)
.pipe(function (chunk, enc, tCb) {
result += chunk.toString('utf8'); // binary to utf8
tCb();
})
@jonsullivan
jonsullivan / gist:73139d1b8776c9b0493d
Created November 11, 2014 00:19
Node.js Salesforce module research
http://www.redargyle.com/blog/introduction-node-js-salesforce/
https://github.com/jsforce/jsforce
https://www.npmjs.org/package/node-salesforce
https://www.npmjs.org/package/nforce
https://www.npmjs.org/package/salesforce-api
@jonsullivan
jonsullivan / gist:4697947
Created February 2, 2013 15:56
error installing creepagram with new user
anon@ubuntu:~/creepagram$ jitsu deploy
info: Welcome to Nodejitsu punkrider
info: jitsu v0.11.6, node v0.8.18
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in app.js
WARN package.json creepagram@0.0.2-21 No README.md file found!
WARN package.json jade@0.20.3 No README.md file found!
WARN package.json stylus@0.24.0 No README.md file found!
WARN package.json connect@1.9.2 No README.md file found!
@jonsullivan
jonsullivan / dabblet.css
Created September 5, 2012 12:34
Handout design for iPad app
/**
* Handout design for iPad app
*/
div {
font-family:Arial;
}
div.main .handout {
height:30px;
@jonsullivan
jonsullivan / cors-middleware-express-with-proxy.js
Created July 17, 2012 01:22
node.js CORS http-proxy / express middleware
// node.js proxy server example for adding CORS headers to any existing http services.
// yes, i know this is super basic, that's why it's here. use this to help understand how http-proxy works with express if you need future routing capabilities
var httpProxy = require('http-proxy'),
express = require('express');
var proxy = new httpProxy.RoutingProxy();
var proxyOptions = {
host: '192.168.3.11',
if ( is_page("quizzes") ) {
echo "quizzes";
}
else if ( is_page("course-management") ) {
echo "course-management";
}
else if ( is_page("online-learning") ) {
echo "online-learning";
}
else if ( is_page("sell-your-courses") ) {
@jonsullivan
jonsullivan / gist:2004331
Created March 9, 2012 00:30
javascript equality
var obj1 = obj2 = {}; obj1 == obj2;
true
var obj1 = obj2 = {}; obj1 === obj2;
true
var obj1 = {}; var obj2 = {}; obj1 === obj2
false
var obj1 = {}; var obj2 = {}; obj1 == obj2
false
@jonsullivan
jonsullivan / jitsu_deploy_err.txt
Created March 8, 2012 20:26
Jitsu deploy error
anon@ubuntu:~/creepagram$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in app.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /home/anon/creepagram/package.json
data:
data: {