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 Array | |
def just_like_map | |
r = [] | |
self.each do |a| | |
r << yield(a) | |
end | |
r | |
end | |
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
call pathogen#runtime_append_all_bundles() | |
set noswapfile | |
filetype plugin indent on | |
" Make Vim remember cursor position | |
if has("autocmd") | |
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | |
\| exe "normal! g'\"" | endif | |
endif |
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
#!/usr/bin/env ruby | |
git_bundles = [ | |
"git://github.com/msanders/snipmate.vim.git", | |
"git://github.com/thogg4/only-primary-nerdtree.git", | |
"git://github.com/timcharper/textile.vim.git", | |
"git://github.com/tpope/vim-cucumber.git", | |
"git://github.com/tpope/vim-fugitive.git", | |
"git://github.com/tpope/vim-git.git", |
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
create role myapp with createdb login password 'myapp'; // 'login' is optional if you plan to use psql | |
// with newer versions of Rails, 'rake db:create:all' will create all the databases listed in config/database.yml | |
select * from pg_user; // verify user created | |
select * from pg_shadow; // sysid listed here | |
create database myapp_development owner myapp; | |
create database myapp_test owner myapp; |
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
module Rack | |
class ExceptCatcher | |
def initialize(app, mailer) | |
@app = app | |
@mailer = mailer | |
@ignore = [404] | |
@hash_blacklist = %w(rack.session.options) | |
end | |
def call(env) |
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
[['United States', [['Alabama', 'AL'], ['Alaska', 'AK'], ['Arizona', 'AZ'], ['Arkansas', 'AR'], ['California', 'CA'], ['Colorado', 'CO'], ['Connecticut', 'CT'], ['Delaware', 'DE'], ['District of Columbia', 'DC'], ['Florida', 'FL'], ['Georgia', 'GA'], ['Hawaii', 'HI'], ['Idaho', 'ID'], ['Illinois', 'IL'], ['Indiana', 'IN'], ['Iowa', 'IA'], ['Kansas', 'KS'], ['Kentucky', 'KY'], ['Louisiana', 'LA'], ['Maine', 'ME'], ['Maryland', 'MD'], ['Massachusetts', 'MA'], ['Michigan', 'MI'], ['Minnesota', 'MN'], ['Mississippi', 'MS'], ['Missouri', 'MO'], ['Montana', 'MT'], ['Nebraska', 'NE'], ['Nevada', 'NV'], ['New Hampshire', 'NH'], ['New Jersey', 'NJ'], ['New Mexico', 'NM'], ['New York', 'NY'], ['North Carolina', 'NC'], ['North Dakota', 'ND'], ['Ohio', 'OH'], ['Oklahoma', 'OK'], ['Oregon', 'OR'], ['Pennsylvania', 'PA'], ['Puerto Rico', 'PR'], ['Rhode Island', 'RI'], ['South Carolina', 'SC'], ['South Dakota', 'SD'], ['Tennessee', 'TN'], ['Texas', 'TX'], ['Utah', 'UT'], ['Vermont', 'VT'], ['Virginia', 'VA'], ['Washington', |
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
$ -> | |
Stripe.setPublishableKey($('meta[name="stripe-key"]').prop('content')) | |
Striper.init | |
Striper = | |
init: (options) -> | |
defaults = | |
form: 'form.billing' | |
formButton: '.billing_button' | |
errorContainer: '.stripe_error' |
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
# Public: Returns an Array of States (for use in Select Tags) | |
# | |
# short - (bool) If you want the function to return State Abreviations or full state names. | |
# | |
# Returns array. | |
def state_list(short=false) | |
if short | |
return ['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'] | |
else | |
return ['Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','Florida','Georgia','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','New Hampshire','New Jersey','New Mexico','New York','North Carolina','North Dakota','Ohio','Oklahoma','Oregon','Pennsylvania','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Vermont','Virginia','Wash |
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
module ConditionalValidations | |
attr_accessor :validated_fields | |
def field_is_required?(field) | |
if !validated_fields.blank? | |
validated_fields.include?(field) | |
end | |
end | |
def conditionally_validate(attribute, options=nil) |
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
defaults write NSGlobalDomain KeyRepeat -int 0 |
OlderNewer