This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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 | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the exact error is `uninitialized constant Delayed::Job` | |
# in your config/initializers/delayed_job.rb | |
Delayed::Worker.backend = :active_record |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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>_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@form = Terra::Form.create(YAML::load_file "foo.yml") | |
<!-- The entire <form>...</form> --> | |
<%= @form %> | |
<!-- Renders p > label + input --> | |
<%= @form.field "name" %> | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Join | |
def self.[](id) | |
super && db.exists(key(id, :exists)) | |
end | |
def create | |
super | |
set key(:exists), 1 | |
expire key(:exists), 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Post < Ohm::Model | |
include Ohm::Typecast | |
attribute :price, Decimal | |
end | |
post = Post.new(:price => "FooBar") | |
post.price == "FooBar" | |
# => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'ohm' | |
require 'lunar' | |
require 'pagination' | |
require 'haml' | |
helpers Pagination::Helpers | |
class Post < Ohm::Model |
OlderNewer