Skip to content

Instantly share code, notes, and snippets.

Naomi: dinner
au gratin potatoes, meatloaf with mashed potatoes, or spaghetti with meatballs
Sent at 10:24 AM on Monday
me: hmmm
good options
meatloaf with meatballs au gratin
seriously though, meatloaf sounds awesome
Sent at 7:00 PM on Wednesday
me: heh, I like that we've started doing alt content
manufacturer_specs = [{name: "width", value: "10"}]
hash = {name: "product name", manufacturer_specs: manufacturer_specs}
product_hashes = [hash]
Product.collection.insert(product_hashes)
development:
# Configure available database sessions. (required)
sessions:
# Defines the default session. (required)
default:
# Defines the name of the default database that Mongoid can connect to.
# (required).
database: the_guide_development
# Provides the hosts the default session can connect to. Must be an array
# of host:port pairs. (required)
development:
# Configure available database sessions. (required)
sessions:
# Defines the default session. (required)
default:
# Defines the name of the default database that Mongoid can connect to.
# (required).
database: the_guide_development
# Provides the hosts the default session can connect to. Must be an array
# of host:port pairs. (required)
development:
# Configure available database sessions. (required)
sessions:
# Defines the default session. (required)
default:
# Defines the name of the default database that Mongoid can connect to.
# (required).
database: the_guide_development
# Provides the hosts the default session can connect to. Must be an array
# of host:port pairs. (required)
<table>
<tr>
<td>outer</td>
</tr>
<tbody>
<tr>
<td>outer</td>
</tr>
<tr>
<td>
whatever is in a content_part called "<whatever is in part='stuff'> Header"
display_name_from_part
display_name
whatever is inside part="foobar"
hard-coded "Section"
module Mongoid
module Sluggable
def self.included(klass)
klass.field :slug, type: String, default: ""
klass.before_validation :generate_slug
klass.after_save :add_slug_history
klass.validates :slug, presence: true
klass.validate :slug_uniqueness
klass.validate :slug_history_path
require "spec_helper"
describe Mongoid::Sluggable do
[:article, :brand, :author, :product].each do |subject|
describe subject.to_s.camelcase do
before(:each) do
@klass = subject.to_s.camelcase.constantize
@lukebergen
lukebergen / gist:4557435
Created January 17, 2013 16:48
super-basic game window
require 'gosu'
class GameWindow < Gosu::Window
def initialize
super 1280, 800, false
self.caption = "neato game"
end
def draw
# drawing stuff