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 / nonblocking.tcl
Created Jun 7, 2012
Attempting Non-blocking IO with TCL
View nonblocking.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 Aug 7, 2012
HTML for d3_identity error
View d3-example.html
<!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 Aug 29, 2012
overloading constructor
View Stupid.js
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 Sep 1, 2012
First Jitsu deploy fails
View Jistu Deploy fail
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
View MongoBadData
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 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
You can’t perform that action at this time.