Skip to content

Instantly share code, notes, and snippets.

View semanticart's full-sized avatar

Jeffrey Chupp semanticart

View GitHub Profile
desc "Creates a static copy of your site by iterating your thingies."
task :make_static do
static_dir = File.join(File.dirname(__FILE__), 'static')
Dir.mkdir(static_dir) unless File.directory?(static_dir)
require 'sinatra'
Sinatra::Application.default_options.merge!(
:run => false,
:env => :production,
:views => File.dirname(__FILE__) + "/views"
class Child
belongs_to :master, :polymorphic => true
end
class HumanParent
has_many :organs
end
class RobotOverlord
has_many :spark_plugs
require 'rubygems'
require 'dm-core'
require 'dm-is-versioned'
require 'dm-timestamps'
DataMapper.setup(:default, 'mysql://localhost/my_db')
class Article
include DataMapper::Resource
property :id, Integer, :serial => true
# what is going on with Hash.new([])?
lines = [
[1,2],
[3,4],
[5,6],
[5,6.5],
[7,8]
]