Skip to content

Instantly share code, notes, and snippets.

John Tantalo tantalor

Block or report user

Report or block tantalor

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
tantalor / go.js
Created Oct 10, 2011
Prime sieve in Go-flavored JavaScript
View go.js
#!/usr/bin/env node
var sys = require('sys');
function go (fn) {
setTimeout(fn, 0);
var chan = function () {
this.readers = []; // [cb, ...]
tantalor /
Created Oct 3, 2011
Perl script to URI-escape JavaScript for bookmarklets
#!/usr/bin/env perl
# Written by John Gruber, taken with permission from:
use strict;
use warnings;
use URI::Escape qw(uri_escape_utf8);
use open IO => ":utf8", # UTF8 by default
":std"; # Apply to STDIN/STDOUT/STDERR
tantalor / generator.js
Created Apr 20, 2011
buffering asynchronous iterator pattern
View generator.js
// produce: accepts a cb which is called with an array of items
// initial: initial array of results to return
// returns a function which accepts a cb which is called with one item
// each time it is called
function generator(produce, initial) {
var items;
var waiting = [];
var next = function (cb) {
if (items && items.length) {
View html.js
{"html": "line<br>break"}
tantalor /
Created Mar 12, 2011
Combines svn blame and diff.
use strict;
use List::Util 'max';
my ($from, $to) = @ARGV
or die "usage: $0 OLD-URL[\@OLDREV] NEW-URL[\@NEWREV]\n";
my @diff = `svn diff $from $to` or die;
my @blame = map {/^\s*(\d+)/} `svn blame $to` or die;
tantalor / counters.js
Created Feb 15, 2011
Starcraft 2 counters for basic units (node)
View counters.js
ZERGLING = 'Zergling',
ROACH = 'Roach',
HYDRALISK = 'Hydralisk',
BANELING = 'Baneling',
MARINE = 'Marine',
HELLION = 'Hellion',
MARAUDER = 'Marauder',
REAPER = 'Reaper',
TANK = 'Siege Tank',
tantalor /
Created Jan 27, 2011
A perl quine.
my ($q, $n) = ("'", chr(10));
my $s = '#!/usr/bin/perl%smy ($q, $n) = ("%s", chr(10));%smy $s = %s%s%s;%sprintf $s, $n, $q, $n, $q, $s, $q, $n, $n;%s';
printf $s, $n, $q, $n, $q, $s, $q, $n, $n;
View slideshow.html
<div id="slideshow">
<img src="">
<img src="" style="display:none">
<img src="" style="display:none">
<img src="" style="display:none">
<img src="" style="display:none">
<script type="text/javascript">
var ims = document.getElementById('slideshow').children;
View github.jquery.js
jQuery.githubUser = function(username, callback) {
jQuery.getJSON("" + username + "?callback=?", callback);
jQuery.fn.loadRepositores = function(username) {
this.html("<span>Querying GitHub for repositories...</span>");
var target = this;
View .screenrc_ssh
escape ``
screen -t "host 1" ssh host1
screen -t "host 1" ssh host1
screen -t "host 2" ssh host2
screen -t "host 2" ssh host2
screen -t "host 3" ssh host3
screen -t "host 3" ssh host3
You can’t perform that action at this time.