Skip to content

Instantly share code, notes, and snippets.

View garrettwilkin's full-sized avatar

Garrett Wilkin garrettwilkin

View GitHub Profile
@garrettwilkin
garrettwilkin / nonblocking.tcl
Created June 7, 2012 15:10
Attempting Non-blocking IO with TCL
#Non-blocking channel
set nb "data.txt"
set data [open $nb r]
fconfigure $data -blocking 0
puts "$nb [fconfigure $data]"
#Blocking channel
set bl "data2.txt"
set data2 [open $bl r]
puts "$bl [fconfigure $data2]"
@garrettwilkin
garrettwilkin / d3-example.html
Created August 7, 2012 05:10
HTML for d3_identity error
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="src/d3/d3.js"></script>
<script type="text/javascript" src="src/d3/d3.geom.js"></script>
<script type="text/javascript" src="src/d3/d3.layout.js"></script>
</head>
<body>
<div id="viz1"></div>
<div id="viz2"></div>
@garrettwilkin
garrettwilkin / Stupid.js
Created August 29, 2012 14:40
overloading constructor
function Event(kind, method, url, data) {
this.kind = kind;
this.method = method;
this.url = url;
this.data = data;
this.milliseconds = new Date().getTime();
};
/*
function Event( obj ) {
@garrettwilkin
garrettwilkin / Jistu Deploy fail
Created September 1, 2012 00:33
First Jitsu deploy fails
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
warn: There is no package.json file in /Users/gw/Code/HackerClubProjectOne
warn: Creating package.json at /Users/gw/Code/HackerClubProjectOne/package.json
help:
help: A package.json stores meta-data about an app
help: In order to continue we'll need to gather some information about the app
@garrettwilkin
garrettwilkin / MongoBadData
Created September 2, 2012 03:12
Bad Data Decision
I wrote this to standardize all the meta data that i wanted in my documents:
function Shlock(kind, method, url, data) {
this.kind = kind;
this.method = method;
this.url = url;
this.data = data;
this.time = new Date().toJSON();
};
@garrettwilkin
garrettwilkin / gist:3611839
Created September 3, 2012 18:30
Error while building nodejitsu handbook
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 September 4, 2012 04:20
Another failed deploy
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:
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',
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 September 5, 2012 15:24
Weird ACCES error ???
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