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 / Capfile
Created November 5, 2009 19:42
require 'capistrano/version'
load 'deploy'
# Customize the following variables
set :domain, "host.example.com"
set :user, "username"
set :application, "my_wordpress_blog"
set :deploy_to, "/var/www/apps/#{application}"
# These variables probably don't need to change
(function($) {
$.fn.defaultvalue = function() {
// Scope
var elements = this;
var args = arguments;
var c = 0;
return(
elements.each(function() {
$(this).css('color', '#aaa');
# outtolunch_template
file 'config/routes.rb', <<-CODE
ActionController::Routing::Routes.draw do |map|
end
CODE
file 'config/initializers/uri_ext.rb', <<-CODE
URI::PATTERN::UNRESERVED.replace("+-_.!~*'()a-zA-Z\\d")
CODE
# mig_rails_template.rb
file 'config/routes.rb', <<-CODE
ActionController::Routing::Routes.draw do |map|
end
CODE
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/favicon.ico"
document.cookie.split(';').each(function(cookie) {
if(cookie.indexOf('__utmz') != '-1') utmz = cookie;
});
var cpc_regex = new RegExp(".*?utmcmd=([a-z]+)\|");
medium = utmz.match(cpc_regex)[1];
var gclid_regex = new RegExp(".*?utmgclid=([\_0-9A-Za-z]+)\|");
adwords = utmz.match(gclid_regex)[1];
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
@mig
mig / cookie_auth.rb
Created June 16, 2009 16:08
extracted cookie auth from restful_authentication
@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
(defun refresh-file ()
(interactive)
(revert-buffer t t t)
)
(global-set-key [f5] 'refresh-file)
# Sending Public Key to Remote Servers
function authme {
ssh $1 'cat >>.ssh/authorized_keys' <~/.ssh/id_rsa.pub
}