Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Trott btrott

  • Maven
  • San Francisco, CA
View GitHub Profile
View gist:444317
<!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 Nov 2, 2010
Perl implementations of the list2str functions at http://www.python.org/doc/essays/list2str.html.
View list2str.pl
#!/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 Jan 4, 2011
Prompt for OS X voice input
View gist:764398
#!/usr/bin/env python
from subprocess import call
while 1:
say = raw_input('say? ')
call(['say', say])
You can’t perform that action at this time.