Skip to content

Instantly share code, notes, and snippets.

View supaspoida's full-sized avatar

Lar Van Der Jagt supaspoida

View GitHub Profile
# 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.
require 'rubygems'
require 'fastercsv'
class Discover
attr_accessor :data
def initialize(file)
@data = FasterCSV.read(file, :headers => true, :header_converters => :symbol)
end
<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>
# haml + liquid example
#
# James MacAulay 2009
require 'rubygems'
require 'liquid'
require 'haml'
template = <<EOF
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
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