Skip to content

Instantly share code, notes, and snippets.

View supaspoida's full-sized avatar

Lar Van Der Jagt supaspoida

View GitHub Profile
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
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
# haml + liquid example
#
# James MacAulay 2009
require 'rubygems'
require 'liquid'
require 'haml'
template = <<EOF
<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>
require 'rubygems'
require 'fastercsv'
class Discover
attr_accessor :data
def initialize(file)
@data = FasterCSV.read(file, :headers => true, :header_converters => :symbol)
end
# 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.
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
~/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
=============================
Setlist Format Template
=============================
- !ruby/object:Importer::Show
date:
venue:
locale:
name:
sets:
- !ruby/object:Show
date: 12/31/2008
venue:
name: The Note
locale: West Chester, PA
sets:
one:
- Crutch
- Dead Clowns
- One Rabbit Race ->