Skip to content

Instantly share code, notes, and snippets.

TJ Holowaychuk tj

Block or report user

Report or block tj

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
View coros.rb
def receive(co)
let status, val = coroutine.resume(co)
return val
end
def send(x)
coroutine.yield(x)
end
View README.md

A test for the new topojson.merge functionality that will be available in the next release of TopoJSON, 1.6. The state boundaries are computed by merging the county boundaries!

The merge algorithm appears to have some issues with Virginia’s small counties; I am currently investigating this problem.

View lame.js
function shutdown() {
var times = 0;
process.on('SIGINT', function(){
trapped('INT');
});
process.on('SIGQUIT', function(){
trapped('QUIT');
});
View hackpad.css
body {
background-color: white;
color: rgba(0,0,0,0.8);
font-family: Georgia,Cambria,"Times New Roman",Times,serif;
}
#editor {
box-shadow: none
}
@tj
tj / hackpad.css
Created Jan 15, 2015
Hackpad theme
View hackpad.css
body {
background-color: white;
color: rgba(0,0,0,0.8);
}
#editor {
box-shadow: none
}
ul.listtype-hone {
View gist:da8975b2084f4e61ad72
2015/02/10 08:12:33 [pub] clear events topic
2015/02/10 08:12:33 [sub] [events:example] clear
2015/02/10 08:12:33 [pub] publish events hello 0
2015/02/10 08:12:34 [pub] publish events hello 1
2015/02/10 08:12:34 [pub] publish events hello 2
2015/02/10 08:12:34 [pub] publish events hello 3
2015/02/10 08:12:34 [pub] publish events hello 4
2015/02/10 08:12:34 [pub] publish events hello 5
2015/02/10 08:12:34 [pub] publish events hello 6
2015/02/10 08:12:34 [pub] publish events hello 7
View context.go
ctx, err := context.New("red-extract", Version, args["--apex"].(string))
View example.go
type Worker struct {
*context.Context
}
func (w *Worker) SomeMethod(){
...
w.Stats.IncrBy(n, "events", "published")
w.Log.Info("parsed %s in %s (size=%s) (events=%d)", file, time.Since(start), size, n)
}
View gist:555a79290234af579d26
avg-cpu: %user %nice %system %iowait %steal %idle
21.28 0.00 1.28 0.00 0.00 77.44
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
xvda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
xvdb 0.00 5271.00 1163.00 2835.00 4652.00 37240.00 20.96 3.20 0.80 0.27 1.02 0.06 24.80
avg-cpu: %user %nice %system %iowait %steal %idle
21.23 0.00 1.02 0.26 0.26 77.24
View gist:32c4ed2a0d0d5f6a4fdf
console.log('starting with node %s', process.version)
setInterval(function(){ console.log('running') }, 5000)
You can’t perform that action at this time.