Skip to content

Instantly share code, notes, and snippets.

View rjack's full-sized avatar

Giacomo Ritucci rjack

View GitHub Profile
@rjack
rjack / index.html
Created October 1, 2010 23:24
Unstoppable Web Worker
<!DOCTYPE>
<html>
<head></head>
<body>
<p>Start the worker from the browser console (fire up a CPU monitor to
have some sort of visual feedback)</p>
<pre>worker.postMessage("run")</pre>
<p>you will NOT be able to stop it with</p>
<pre>worker.postMessage("stop")</pre>
<p>What I'd expected:</p>
@rjack
rjack / uuid-truncated-hash-collision-count.js
Created January 28, 2011 11:22
Test for stackoverflow question http://bit.ly/f3Tn0f. Runs in nodejs.
var uuid = require('node-uuid'), // npm install node-uuid
crypto = require('crypto');
var UUID_NUM = 1000000;
var uuid_table = {};
@rjack
rjack / next_permutation.js
Created April 10, 2011 20:53
Trova la prossima permutazione in ordine alfabetico.
function partial_reverse (arr, i, j)
{
var tmp;
j--;
while (i < j) {
tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
i++; j--;
@rjack
rjack / index.html
Created April 18, 2011 09:18
d3.js: understanding events and event targets
<!DOCTYPE>
<html>
</html>
@rjack
rjack / proxy.js
Created April 19, 2011 17:06
Giving node-http-proxy a try
var http = require("http"),
url = require("url");
var server = http.createServer(function (req, res) {
console.log("connection count:" + server.connections);
var fwd_url = url.parse(req.url),
fwd_req_opts = {
agent: false,
host: fwd_url.hostname,
@rjack
rjack / node-rss.js
Created April 21, 2011 15:40
Node RSS output
// This module should listen for http requests to a given URL and output an RSS feed.
var connect = require("connect");
connect.createServer(
connect.logger(),
connect.router(routes)
).listen(8080);
@rjack
rjack / icon.png
Created May 6, 2011 21:35
Google Chrome Extensions Tutorial: Getting Started (Hello, World!)
icon.png
@rjack
rjack / background.html
Created May 6, 2011 22:29
Chrome Extensions Background Page Test
<!-- TODO -->
@rjack
rjack / style.css
Created May 6, 2011 23:19
Chrome Extensions Packaged App
body {
font-family: Helvetica, "sans-serif"
}
@rjack
rjack / README.markdown
Created May 10, 2011 11:51
learn-backbone

Learning Backbone.js