Public Gists by jamiew

gist: 234100 my .screenrc
Gravatar
Fri Nov 13 11:48:13 -0800 2009
1
2
3
## jamiew
## screen config
vbell on
gist: 234099 My VIM config (.vimrc)
Gravatar
Fri Nov 13 11:47:21 -0800 2009
1
2
3
set expandtab " Use spaces instead of tabs
set autoindent " Inherit indent from previous line
syntax on
Gravatar
Tue Nov 03 17:27:37 -0800 2009
1
2
3
--- controller ---
def index
  load_videos = lambda do
Gravatar
Wed Sep 16 18:07:53 -0700 2009
1
2
3
# a simple ActiveRecord->HTML table of attributes default (why isn't this builtin?)
# in the case of arrays, just do many tables
# TODO: move to a plugin or somesuch?
Gravatar
Fri Sep 11 11:53:34 -0700 2009
1
2
3
                           NOOOOOOOOOOOOOOOOOOOOOOO!!!!!
                       .-.
 
Gravatar
Thu Aug 13 09:55:59 -0700 2009
1
2
3
  desc "Raises an error if there are pending migrations"
  task :abort_if_pending_migrations => :environment do
    if defined? ActiveRecord
Gravatar
Thu Jul 23 11:04:46 -0700 2009
1
2
3
#!/usr/bin/env ruby
#
# quickly lookup # of google search results for a given term
Gravatar
Wed Jul 22 08:54:43 -0700 2009
1
2
3
#!/usr/bin/env ruby
# quick Google PageRank lookup
# usage: ~/bin/pagerank jamiedubs.com
Gravatar
Thu Jul 16 10:19:56 -0700 2009
1
2
3
SELECT count(*) TABLES,
concat(round(sum(table_rows)/1000000,2),'M') rows,
concat(round(sum(data_length)/(1024*1024*1024),2),'G') DATA,
Gravatar
Mon Jul 13 18:43:56 -0700 2009
1
2
3
# setting up an R&D slice
 
# 1st things first, copy over our bash & screen config...
Gravatar
Wed Jul 01 12:37:25 -0700 2009
1
2
3
#!/usr/bin/env ruby
# sup luke; jdubs here
# - put the docs and helper scripts inline for syntax highlighting joy
Gravatar
Fri May 29 12:42:12 -0700 2009
1
2
3
Deploying a Rails App with EC2 + S3 + Ubuntu
============================================
 
Gravatar
Mon May 18 11:50:35 -0700 2009
1
2
3
// instantly implement a konami code easter-egg!!!!
// from http://static.jquery.com/files/rocker/scripts/custom.js
// where it's labeled "hehe" and would open up a javascript guitar hero (!)
gist: 70195 HI CASEY
Gravatar
Wed Feb 25 06:39:10 -0800 2009
1
2
3
ffmpeg -hq -ss 00:00:00 -t 00:45:00 -i <movie.avi> -target svcd ./m1.mpg
ffmpeg -hq -ss 00:45:00 -t 00:45:00 -i <movie.avi> -target svcd ./m2.mpg
ffmpeg -hq -ss 01:30:00 -t 00:25:29 -i <movie.avi> -target svcd ./m3.mpg
Gravatar
Sun Feb 22 16:47:54 -0800 2009
1
2
3
CREATE TABLE `audits` (
  `id` int(11) NOT NULL auto_increment,
  `auditable_id` int(11) default NULL,
gist: 21391 munin plugin to monitor Pas...
Gravatar
Fri Oct 31 11:55:34 -0700 2008
1
2
3
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
gist: 21328 munin plugin for Passenger ...
Gravatar
Fri Oct 31 08:27:58 -0700 2008
1
2
3
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
Gravatar
Fri Oct 31 08:25:49 -0700 2008
1
2
3
def sync_changesets
  return unless ENABLE_SUBVERSION
 
Gravatar
Fri Oct 31 08:25:26 -0700 2008
1
2
3
def delete_dups_for(model, collect_by)
  keep_array = Hash.new { |h,k| h[k] = [] }
  delete_array = []
Gravatar
Sat Sep 06 16:30:07 -0700 2008
1
2
3
## from railscasts: http://railscasts.com/episodes/124-subdomains
 
# models/invitation.rb