Skip to content

Instantly share code, notes, and snippets.

View jacoby's full-sized avatar
🌮
I ❤️ Tacos

Dave Jacoby jacoby

🌮
I ❤️ Tacos
View GitHub Profile
#!/usr/bin/perl
# READING DIRECT MESSAGES
use 5.010 ;
use strict ;
use Carp ;
use Data::Dumper ;
use Getopt::Long ;
use IO::Interactive qw{ interactive } ;
#!/usr/bin/env ruby
# Rock Paper Scissors
class WrongNumberOfPlayersError < StandardError ; end
class NoSuchStrategyError < StandardError ; end
def rps_tournament_winner ( tourney )
# if tourney[0][0] is a string, that means that's a match
# if not
#!/usr/bin/env ruby
class FooBar
include Enumerable
@array_out = Array.new
def initialize( array1 , array2 )
if array1 != [] and array2 != []
for i in array1
for j in array2
k = [i,j].join("|")
#!/usr/bin/env ruby
class FooBar
include Enumerable
def initialize( array1 , array2 )
@array_out = Array.new
if array1 != [] and array2 != []
for i in array1
for j in array2
k = [i,j].join("|")
@jacoby
jacoby / index.html.haml
Created March 12, 2012 00:58
Fun with Potatoes
# This file is app/views/movies/index.html.haml
%h1 All Movies
%table#movies
%thead
%tr
%th{ :class => @title_class }= link_to "Movie Title" , '/movies?sort=title' , :id => "title_header"
%th Rating
%th{ :class => @rel_date_class }= link_to "Release Date" , '/movies?sort=release_date' , :id => "release_date_header"
%th More Info
@jacoby
jacoby / data.R
Created March 19, 2012 17:25
data.R
# R file template in Template-Toolkit
w_avg <- c( [% weight_average %] )
date <- c( [% dates %] )
w_count <- c( [% measurement_count %] )
weight <- c( [% weight %] )
png(
filename="data.png" ,
width = 600 ,
@jacoby
jacoby / .perltidyrc
Created April 26, 2012 13:54
My .perltidyrc -- configuration for Perltidy
# my .perltidyrc config file
# http://perldoc.perl.org/perlstyle.html
--backup-and-modify-in-place
#--cuddled-else
--continuation-indentation=4
--indent-columns=4
#--maximum-line-length=78
#--line-up-parentheses
--opening-brace-always-on-right
@jacoby
jacoby / artist_rename.pl
Created August 10, 2012 16:45
My perl script for renaming MP3s to a more sane naming convention
#!/usr/bin/perl
use strict ;
use warnings ;
use 5.010 ;
use subs qw( rename_mp3s rename_mp3 ) ;
use File::Copy ;
use MP3::Tag ;
print qq{RENAMING\n} ;
@jacoby
jacoby / gen_data.R
Created December 6, 2012 14:59
Making a PNG plot with R and libCairo
# R file template in Template-Toolkit
library( Cairo )
w_avg <- c( 270.0000,268.5000,268.0000,268.0000,268.0000,267.6667,267.5714,267.5000,267.1111,267.4000,267.5455,267.5000,267.3846,267.3571,267.4667,267.1250,266.8824,266.7778,266.6316,266.3684,266.2632,266.1053,265.7895,265.7000,265.5000,265.5000,265.4000,265.2381,265.1000,264.7000,264.4000,264.2000,264.0500,263.8500,263.6000,263.6190,263.6190,263.5238,263.3333,263.2857,263.2500,263.2000,263.1000,262.8500,262.6000,262.2105,262.2632,262.1667,262.1111,262.0556,262.0556,261.9444,261.6471,261.3529,261.2353,261.0000,260.8889,260.5000,260.2778,260.2778,260.2941,260.1667,260.0556,259.8333,259.7368,259.5000,259.3500,259.1500,258.8500,258.5714,258.5455,258.4545,258.4783,258.4783,258.4091,258.4091,258.3636,258.4091,258.3182,258.2083,258.1250,258.1667,258.2308,258.1538,258.0769,257.9615,257.8800,257.7500,257.7391,257.6667,257.5833,257.4167,257.2174,257.2174,257.0870,257.0000,256.7391,256.6087,256.5238,256.3636,255.9524,255.6818,255.2609,255.0833,254.9583,254.84
@jacoby
jacoby / StepOne.pm
Created December 6, 2012 16:27
My StepOne .eds Generating Module
package StepOne ;
# PCR_Export tools to create configuration files
# for the StepOne qPCR machine
use 5.010 ;
use strict ;
use warnings ;
use Carp ;
use Cwd qw{ getcwd abs_path } ;