This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hi, I'm Safari 4 and I throw a parse error at this! | |
p.import = function import(lib){ | |
eval(p.ajax(lib)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|-------| |-------| | |
| 12345 | | 67890 | } web application processes | |
|-------| |-------| | |
| | | |
| | | |
\ / \ | |
\ / \ } dtrace probes firing | |
|----| |----| | |
|rack| | ?? | } rack: rack interface to web applications | |
|----| |----| ??: consumer process for dtrace probes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CPU ID FUNCTION:NAME | |
0 18791 request_start:request-start / 4726603687031 | |
0 18790 request_done:request-done / 4726603888782 | |
1 18791 request_start:request-start /favicon.ico 4726627369797 | |
1 18790 request_done:request-done /favicon.ico 4726627530357 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
To check for requests, just use an empty middleware, and check for call()s to it. In our case, use Rack::Probe. We can later add more probes to log env data._ | |
This way requires a patched Ruby to be used though. mri_instrumentation must have a better way._ | |
*/ | |
:::function-entry | |
/copyinstr((int) arg0) == "Rack::Probe" && copyinstr((int) arg1) == "call"/ | |
{ | |
printf("Class: %s \t Method: %s\t", copyinstr((int) arg0), copyinstr((int) arg1)); | |
trace(timestamp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Probes fire when a Ruby process starts and ends garbage collection. Perhaps similar to mri_instrumentation's implementation?_ | |
*/ | |
pid$1::rb_gc:entry | |
{ | |
printf("Garbage Collection has started!\t"); | |
trace(timestamp); | |
printf("\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem uninstall visionmedia-commander -v 3.3.0 | |
gem install visionmedia-commander -v 3.2.9 --source http://gems.github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install visionmedia-jspec --source http://gems.github.com | |
cd ~/Library/Application\ Support/TextMate/Bundles/ && | |
git clone git://github.com/visionmedia/jspec.tmbundle.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:::object-free | |
/ pid == $1 / | |
{ | |
printf("Bai bai, object. We barely knew thee.\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Our lovely namespace. | |
var rack = {}; | |
// Access to all set Probes | |
rack.Probes = {}; | |
// An event will be added through this function | |
rack.Probes.addEvent = function( pid, timestamp, name, arguments ){ | |
if(!isDefined(rack.Probes[name])) | |
new rack.Probe(name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(matrix). | |
-export([do_this_once/0, update_cell/2, read_cell/2]). | |
%% index is a tuple: {user_id, article_id} | |
-record(cell, {index, value = 0 }). | |
do_this_once() -> | |
mnesia:create_schema([node()]), | |
mnesia:start(), | |
mnesia:create_table(cell, |