Skip to content

Instantly share code, notes, and snippets.

" ir_black color scheme (modified)
" More at: http://blog.infinitered.com/entries/show/8
" ********************************************************************************
" Standard colors used in all ir_black themes:
" Note, x:x:x are RGB values
"
" normal: #f6f3e8
"
# the exact error is `uninitialized constant Delayed::Job`
# in your config/initializers/delayed_job.rb
Delayed::Worker.backend = :active_record
" Switch between windows, maximizing the current window
map ,.j <C-W>j<C-W>_
map ,.k <C-W>k<C-W>_
map ,.h <C-W>h<C-W>_
map ..l <C-W>l<C-W>_
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-H> <C-W>h<C-W>_
map <C-L> <C-W>l<C-W>_
@form = Terra::Form.create(YAML::load_file "foo.yml")
<!-- The entire <form>...</form> -->
<%= @form %>
<!-- Renders p > label + input -->
<%= @form.field "name" %>
---
# Install snipMate for vim, then save this as ~/.vim/snippets/css.snippets
# (Also remove these comment lines, I'm not sure if snipMate can handle them!)
#
# Common usage:
# - call the initials of your rule (with or without the value) and press tab
# e.g.: "fwb" => "font-weight: bold;"
# "c" => "color: ____;"
# - the only exception is 'position: xxx'
# ("por" for "position: relative"... since "pr" clashes with padding-right)
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
require 'sinatra/base'
module Sinatra
# module to catch Sinatra errors and send a email
module ExceptionMailer
def initialize(app)
@app = app
# set parameters here..
yield self if block_given?
end
class Join
def self.[](id)
super && db.exists(key(id, :exists))
end
def create
super
set key(:exists), 1
expire key(:exists), 300
class Post < Ohm::Model
include Ohm::Typecast
attribute :price, Decimal
end
post = Post.new(:price => "FooBar")
post.price == "FooBar"
# => true
require 'rubygems'
require 'sinatra'
require 'ohm'
require 'lunar'
require 'pagination'
require 'haml'
helpers Pagination::Helpers
class Post < Ohm::Model