Skip to content

Instantly share code, notes, and snippets.

View mig's full-sized avatar

Matthew Swasey mig

  • LivingSocial
  • Washington DC
View GitHub Profile
@mig
mig / phig.el
Created January 12, 2009 21:57
;; emacs-rails-kit-mac - some configuration that makes carbon emacs a little nicer
;; Some Mac-friendly key counterparts
(global-set-key (kbd "M-s") 'save-buffer)
(global-set-key (kbd "M-z") 'undo)
(global-set-key (kbd "M-c") 'copy-region-as-kill)
(global-set-key (kbd "M-k") 'kill-region)
;; Mac font settings
(set-face-font 'default "-apple-dejavu sans mono-medium-r-normal--15-0-72-72-m-0-iso10646-1")
// jsCron - by Andrés Nieto
var jsCron = {
items:[],
interval: null,
parse: function(strUnix) {
return strUnix.match(/^(\d+|\*) (\d+|\*) (\d+|\*) (\d+|\*) (\d|\*) +(\w+)/);
},
check: function() {
var hoy = new Date();
@mig
mig / base.css
Created January 17, 2009 00:25
base styles for my personal projects
body {
background-color: #FFF;
font-family: Verdana, Helvetica, Arial;
font-size: 14px;
}
a img {
border: none;
}
@mig
mig / clojure
Created January 19, 2009 07:12
#!/bin/sh
export SRC=/Users/mig/src
export CLOJURE=$SRC/clojure
export CLASSPATH=$CLOJURE/clojure-contrib/clojure-contrib.jar:$CLOJURE/clojure-trunk/clojure.jar
for file in $SRC/jars/*.jars; do
JARS=$JARS:$file
done
CLASSPATH=$CLASSPATH$JARS
java -cp $CLASSPATH jline.ConsoleRunner clojure.lang.Repl
@mig
mig / mocha_stub_path.rb
Created January 21, 2009 15:51 — forked from kommen/mocha_stub_path.rb
Mocha stub_path
module Mocha
module ObjectMethods
def stub_path(path)
path = path.split('.') if path.is_a? String
raise "Invalid Argument" if path.empty?
part = path.shift
mock = Mocha::Mockery.instance.named_mock(part)
exp = self.stubs(part)
if path.length > 0
exp.returns(mock)
# Sending Public Key to Remote Servers
function authme {
ssh $1 'cat >>.ssh/authorized_keys' <~/.ssh/id_rsa.pub
}
(defun refresh-file ()
(interactive)
(revert-buffer t t t)
)
(global-set-key [f5] 'refresh-file)
@mig
mig / gist:128909
Created June 12, 2009 20:48
Installing Erlang on OSX w/o ports
curl -O http://ftp.gnu.org/pub/gnu/gettext/gettext-0.17.tar.gz
tar xvzf gettext-0.17.tar.gz
cd gettext-0.17
./configure --prefix=/usr/local
make
sudo make install
cd ..
sudo perl -MCPAN -e 'shell'
cpan> install Locale::gettext
@mig
mig / cookie_auth.rb
Created June 16, 2009 16:08
extracted cookie auth from restful_authentication
class TopExitPagesReport
include Garb::Resource
include ReportHelper
metrics :pageviews, :exit_rate, :exits
dimensions :request_uri
def self.results_for(profile, date)
new(profile, date)
end