Skip to content

Instantly share code, notes, and snippets.

View thejefflarson's full-sized avatar
👨‍👩‍👧‍👦
being a dad

Jeff Larson thejefflarson

👨‍👩‍👧‍👦
being a dad
View GitHub Profile
if Rails.env.development?
around_filter :perform_profile
end
# In development mode, optionally perform a RubyProf profile of any request.
# Simply pass perform_profile=true in your params.
def perform_profile
return yield unless params[:perform_profile]
require 'ruby-prof'
RubyProf.start
# Create the web server.
server: http.createServer (req, res) ->
params: url.parse req.url, true
if params.pathname is '/pixel.gif'
res.writeHead 200, pixelHeaders
res.end pixel
else
res.writeHead 404, emptyHeaders
res.end ''
record params
[02:38] jashkenas: ryah: if you're around now, I'd be very curious to hear your thoughts on Steve Dekorte's comparison of a Node.js/callback proxy versus an Io/coros proxy:
[02:38] jashkenas: Node: http://www.iolanguage.com/paste/p/f05588fa6.html
[02:38] jashkenas: Io: http://www.iolanguage.com/paste/p/2f7b5fce1.html
[02:39] maqr: jashkenas: my plan is to make a little tool for tumblr theme developers to push up their latest work, rather than having to use tumblr's web interface, if you were wondering :)
[02:39] mjr_: I noticed that one has fewer lines.
[02:39] jashkenas: maqr: fun.
[02:39] maqr: ryah: oh ok, all the buzz i hear is about how it's X times faster than a normal webserver
[02:39] maqr: and i'm not sure what "evented I/O for V8" really means yet :)
[02:40] jashkenas: mjr_: I think that the question is more about whether we're comfortable and settled on writing out the explicit callback form, longhand. Or if it seems like there's room for improvement with this example (coros or not).
[02:40] Tim_S
|____app
| |____downloader.js
| |____editor.js
| |____hotkeys.js
| |____search_parser.js
| |____workspace.js
|____application.js
|____ie
| |____excanvas.js
|____lib
@cowboy
cowboy / walk_dom.js
Created November 21, 2009 21:15
Iterations, anyone? AKA How I wrote a walk_dom method.
// Iterations, anyone? AKA
// How I wrote a walk_dom method.
//
// A JavaScript poem by
//
// "Cowboy" Ben Alman
// 11/21/2009
// A starting point.