Skip to content

Instantly share code, notes, and snippets.

@dmerrick
dmerrick / autotest.rb
Created July 21, 2010 18:32
Use this to make autotest work with Growl.
# save this file as ~/.autotest
# start autospec with ./script/autospec
# you may need to install the "autotest" and "autotest-rails-pure" gems
# if you have any issues getting this to work (like Growl notifications not appearing),
# take a look at the README found here: http://github.com/svoop/autotest-growl
begin
class AddPasswordToOwner < ActiveRecord::Migration
def self.up
add_column :owners, :crypted_password, :string, :limit => 40
add_column :owners, :salt, :string, :limit => 40
end
def self.down
remove_column :owners, :crypted_password
remove_column :owners, :salt
end
@dmerrick
dmerrick / dnmrrck.js
Created May 20, 2010 04:06
A cheap SCVNGR clone to try out node.js
// config variables
var port = 8090,
host = "localhost";
// define the clues and answers
var clues = ['What is the most beautiful programming language?',
'That\'s right! What is the greatest city in the USA?',
'Perfect! Who makes the best online scavenger hunts?'],
answers = ['Ruby',
\documentclass[12pt]{amsart}
% this should add multiline comments
\usepackage{verbatim}
\usepackage{graphicx}
\begin{document}
\noindent
Dana Merrick \\
#!/usr/bin/env ruby -wKU
# http://en.wikipedia.org/wiki/Quadratic_alphabet_code
require 'pp'
class TapCode
attr_reader :letters, :array
def initialize
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'haml'
configure do
set :folder_name, 'pictures_of_me'
set :root, File.dirname(__FILE__)
#!/usr/bin/env ruby -wKU
require 'pp'
require 'open-uri'
# the page that holds the registry (updated often)
registry = 'http://www.iana.org/assignments/language-subtag-registry'
culture_codes = Hash.new('')
current = ""
#!/bin/bash
# Updates all of the git repos in the current dir.
for dir in `find . -depth 2 -name .git | sed -e 's!^..\(.*\)/.*$!\1!;'`;
do echo "Updating $dir..."; cd $dir; git pull; cd ..;
done
#!/usr/bin/env ruby -wKU
# TODO: use the awesome Array#abbrev method
#require 'abbrev' if RUBY_VERSION.to_f <= 1.9
hosts = ["fubar", "foobar"] # hosts you're setting mappings to
aliases = [] # datastructure to hold mappings
# build the datastructure
# starting with "fu" => "fubar", "fub" => "fubar", etc.
@dmerrick
dmerrick / antiafk-s.scpt
Created July 18, 2009 16:35
The short version of my anti-afk bot. Tweak to taste.
-- Anti AFK Bot
-- Warrior edition
-- 12/1/08
-- This program will keep you from AFKing in a WoW battleground.
-- (c) Dana Merrick 2008
-- Released under the MIT License.
log "Starting program"