Skip to content

Instantly share code, notes, and snippets.

View btrott's full-sized avatar

Benjamin Trott btrott

  • The Arena Group
  • San Francisco, CA
View GitHub Profile
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Gallery</title>
</head><body>
<div id="gallery-widget"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
@btrott
btrott / list2str.pl
Created November 2, 2010 18:11
Perl implementations of the list2str functions at http://www.python.org/doc/essays/list2str.html.
#!/usr/bin/perl -w
use strict;
use Benchmark qw( timethese cmpthese );
use List::Util qw( reduce );
my $list = rand_chars( 256 );
cmpthese( shift || 1, {
f1 => sub { f1( $list ) },
@btrott
btrott / gist:764398
Created January 4, 2011 04:29
Prompt for OS X voice input
#!/usr/bin/env python
from subprocess import call
while 1:
say = raw_input('say? ')
call(['say', say])