Skip to content

Instantly share code, notes, and snippets.

Avatar

Lar Van Der Jagt supaspoida

View GitHub Profile
View matrix_maker.rb
class Nav
def self.padded_selector(sel, max_len)
sel.ljust(max_len)
end
attr_accessor :id, :height, :items, :image
def initialize(attrs={})
attrs.each { |k,v| send("#{k}=", v) }
end
View My Theory of Time Travel in LOST
This is all pulled from a series of posts I made on a message board, so
hopefully it still makes some sense out of context.
=============================================================================
Oh shit, just thought of something. This whole time skipping thing means that
John's 'dreams' could really be memories, ala Desmond suddenly 'remembering'
his encounter with Danny Faraday.
Before all the time skips, John has a bunch of visionary dreams that give him
info about the island, such as how to find that plane. He thinks it's the
View haml_plus_liquid.rb
# haml + liquid example
#
# James MacAulay 2009
require 'rubygems'
require 'liquid'
require 'haml'
template = <<EOF
View Ugly 960gs.html
<div class="gallery wrapper white padding">
<div class="container_12">
<h2>Dixie Diamond</h2>
<div class="grid_9">
<div class="grid_3 alpha">
<center>
<img src="/images/girls/dixiediamond/classy_gal_small.jpg" class="border" alt="Classy Gal" />
</center>
</div>
View discover.rb
require 'rubygems'
require 'fastercsv'
class Discover
attr_accessor :data
def initialize(file)
@data = FasterCSV.read(file, :headers => true, :header_converters => :symbol)
end
View migration_transactional_loop.rb
# This is a mechanism we use often in our migrations. When we have a migration
# that hits every record of a large table, this looping mechanism takes the
# bite away from the migration. This allows us to be transactional in our
# migration while avoiding aggressive locking of the table. Ultimately
# allowing us to do migratory deployments even more frequently during high
# usage areas of the day.
#
# Further, some long migrations that we'd run over a weekend may exceed the
# max transaction time set on our MySQL server. Running smaller transactions
# avoids this sensible restriction.
View firefog_git.sh
cd ~/Library/Application\ Support/Firefox
git init
git add .
git commit -m "Saving FF3 Profile."
git checkout -b ff3.5
open /Applications/Firefox3.5
(close Firefox3.5)
git commit -m "Saving FF3.5 Profile."
git checkout master
open /Applications/Firefox
View harvestgem_timer
~/repos/harvest$ irb
>> require 'harvest'
=> true
@harvest = Harvest(:email => "tomatoist@supaspoida.com",
:password => "123456",
:sub_domain => "tomatoist",
:headers => {"User-Agent" => "Tomatoist", 'Content-Type' => 'application/xml' })
@harvest.timesheet.new(:hours => 3, :notes => 'workdammit', :project_id => 388131, :task_id => 319119, :spent_at => Date.today).save
View bp_setlists.yml
=============================
Setlist Format Template
=============================
- !ruby/object:Importer::Show
date:
venue:
locale:
name:
sets:
View gist:168364
- !ruby/object:Show
date: 12/31/2008
venue:
name: The Note
locale: West Chester, PA
sets:
one:
- Crutch
- Dead Clowns
- One Rabbit Race ->