Skip to content

Instantly share code, notes, and snippets.

@codyhanson
codyhanson / imac_volume.pl
Created January 3, 2014 14:52
Controls the volume on my old iMac
#! /usr/bin/perl
die "usage volume.pl NUMBER" if @ARGV == 0;
$vol = $ARGV[0];
$command = 'sudo osascript -e "set Volume ' . $vol .'"';
system($command);
@codyhanson
codyhanson / prime.py
Created June 20, 2013 21:42
A really inefficient way to compute prime numbers.
#! /usr/bin/env python
curnum = 2
nums = []
while True:
prime = True
for num in nums:
if curnum % num == 0:
prime = False
@codyhanson
codyhanson / gitFetchAll.py
Created June 19, 2013 15:18
Use the littleworkers library to fetch many gitrepos at once.
#! /usr/bin/env python
from littleworkers import Pool
# Define your commands.
commands = [
"cd repo1; git fetch",
"cd repo2; git fetch",
"cd repo3; git fetch",
"cd repo4; git fetch",