Skip to content

Instantly share code, notes, and snippets.

Garrett Wilkin garrettwilkin

Block or report user

Report or block garrettwilkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@garrettwilkin
garrettwilkin / gist:3611839
Created Sep 3, 2012
Error while building nodejitsu handbook
View gist:3611839
airy:handbook gw$ make
ronn --pipe --fragment chapters/toc.md \
| sed -r 's/<h1>([^ ]+) - /<h1>/' \
> chapters/toc.html
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
make: *** [chapters/toc.html] Error 1
@garrettwilkin
garrettwilkin / gist:3616531
Created Sep 4, 2012
Another failed deploy
View gist:3616531
gw@airy ~/C/HackerClubProjectOne> jitsu deploy
info: Welcome to Nodejitsu garrettwilkin
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in main.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /Users/gw/Code/HackerClubProjectOne/package.json
data:
View gist:3616656
gw@airy ~/C/HackerClubProjectOne> jitsu env list
info: Welcome to Nodejitsu garrettwilkin
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command env list
info: Attempting to load env variables for app /Users/gw/Code/HackerClubProjectOne/package.json
info: Listing all environment variables for HackerClubProjectOne
data: {
data: MONGO_USER: 'njitsu',
data: NODE_ENV: 'production',
View gist:3617235
For what it's worth, I've verified that the db connection works on my mac and also from my Linode server.
Maybe there's a discrepancy in the package versions?
The error message seems to indicate that the mongo database object is not created properly.
=========================================
APPLICATION LOGS (latest at top)
=========================================
[09/04 01:38:58 EDT] TypeError: Cannot read property '_serverState' of undefined
@garrettwilkin
garrettwilkin / gist:3638347
Created Sep 5, 2012
Weird ACCES error ???
View gist:3638347
Not sure why I would get EACCES. on Deployment:
gw@airy ~/C/HackerClubProjectOne> jitsu logs
info: Welcome to Nodejitsu garrettwilkin
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command logs app
info: Attempting to load logs for /Users/gw/Code/HackerClubProjectOne/package.json
View gist:3642279
I want to use a function so that i dont have to write the same logic over and over again in my calls to the find function on my MongoDb collections.
Here's the function I want, but notice that it contains 'self.res'. That's cause i just ripped it out of my find(...) call (below). Previously, when this was just an annoymous function, self.res is the HTTP response that we're building.
So how to i access self.res in my callback, if I use a named function, instead of an anonymous function in my find?
function findHandler(err, docs) {
if (!err) {
// Return Success & JSON Content-type
var length = docs.length;
View gist:3642610
function findHandler(err, docs) {
if (!err) {
// Return Success & JSON Content-type
var length = docs.length;
writeMeta(self.res,200,url,length);
// Process results from Mongo
docs.forEach(function(e,i,a) {
//console.log(e,i,a);
@garrettwilkin
garrettwilkin / TileMill.log
Created Sep 9, 2012
TileMill crash on startup
View TileMill.log
gw@airy ~/Code> vim /Users/gw/Library/Logs/TileMill.log
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
@garrettwilkin
garrettwilkin / gist:3724263
Created Sep 14, 2012
Attempting to add new mapping to piratespeak.dictiony "up","aloft"
View gist:3724263
When I execute this URL in my browser:
http://query.yahooapis.com/v1/public/yql?q=insert%20into%20piratespeak.dictionary%20(english_term%2C%20pirate_term)%20values%20(%22up%22%2C%20%22aloft%22)%3B&format=json&env=store%3A%2F%2Fkid666.com%2Fpiratespeak&callback=cbfunc
I get this response:
cbfunc({"query":{"count":1,"created":"2012-09-14T19:42:19Z","lang":"en-US","results":{"result":"Ahoy mate! Ye doth added ye Pirate term \"aloft\" for yonder English term \"up\""}}});
It looks good, but if i go back to the console and get the URL to list everything in piratespeak.dictionary,
@garrettwilkin
garrettwilkin / gist:3729265
Created Sep 15, 2012
Krispin node douche error
View gist:3729265
/Users/gw/Code/douche/lib/douche/wsdl.js:48
var name = operation_tag['@']['name'];
^
TypeError: Cannot read property 'name' of undefined
at WSDL._read_xml (/Users/gw/Code/douche/lib/douche/wsdl.js:50:34)
at WSDL.parse (/Users/gw/Code/douche/lib/douche/wsdl.js:21:10)
at IncomingMessage.WSDL._get (/Users/gw/Code/douche/lib/douche/wsdl.js:108:7)
at IncomingMessage.EventEmitter.emit (events.js:115:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
You can’t perform that action at this time.