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
# Gem: http://rubygems.org/gems/devil | |
# Library: http://openil.sourceforge.net/ | |
# Images for use with this: http://dl.dropbox.com/u/363740/images.zip | |
# To install on snow leopard with homebrew: | |
# 1. brew install devil | |
# 2. gem install devil | |
# 3. ??? | |
# 4. Profit! |
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
Helpers.updateResizeInput = function(el, text){ | |
if(el.localName == "input" || el[0].localName == "input"){ // inputs are a pain | |
el.parent().prepend('<span id="test" />'); | |
var theSpan = $('span#test', el.parent()); | |
theSpan.value = text; | |
Helpers.updateResizeInput(theSpan, text); | |
el.css('font-size', theSpan.css('font-size')); | |
el.css('margin-top', theSpan.css('margin-top')); | |
el[0].value = text; | |
theSpan.remove(); |
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 'steak' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'rack/test' | |
RSpec.configure do |config| | |
def app | |
Capybara.app | |
end | |
config.include Capybara |
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
# Postgres backup script | |
# mynameisrufus | |
# | |
# Cron tab examples: | |
# | |
# daily keeping the last 5 days (run at 1:00AM, 2 minutes after the hour) | |
# | |
# 02 1 * * * postgres /script/db_backup.sh daily /var/backups/db $DATABASE_OWNER 5 >> /var/backups/db/backup.log 2>&1 | |
# | |
# |
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
.input | |
= f.text_area :body | |
= f.hidden_field :commented_by, :value => current_user.email |
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
Feature: Generate a new Synapse app | |
lorem ipsum else | |
Scenario: Generate a new synapse app | |
Given I have no synapse app "my/new/app" # Test that there are no files/dirs for the app | |
When I generate a synapse app "my/new/app" # Trigger the app build | |
Then I should have the generated files for "my/new/app" # Test that all the files are there, Use an after hook to get rid of them after |
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
grey='\e[0;90m' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})" | |
function pat_prompt { | |
(( spare_width = ${COLUMNS} )) | |
prompt=" " |
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
# Factory girl, relaxed. | |
# | |
# Factory.define :user do |f| | |
# f.login 'johndoe%d' # Sequence. | |
# f.email '%{login}@example.com' # Interpolate. | |
# f.password f.password_confirmation('foobar') # Chain. | |
# end | |
# | |
# Factory.define :post do |f| | |
# f.user { Factory :user } # Blocks, if you must. |
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
# Edit this Gemfile to bundle your application's dependencies. | |
## Bundle edge rails: | |
gem "rails", :git => "git://github.com/rails/rails.git" | |
## Bundle the gems you use: | |
# gem "bj" | |
# gem "hpricot", "0.6" | |
# gem "sqlite3-ruby", :require_as => "sqlite3" | |
# gem "aws-s3", :require_as => "aws/s3" |
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
This example shows how to setup an environment running Rails 3 beta under 1.9.1 with a 'rails3' gem set. | |
∴ rvm update --head | |
# ((Open a new shell)) | |
# If you do not already have the ruby interpreter installed, install it: | |
∴ rvm install 1.9.1 | |
# Use the ruby + gem set | |
∴ rvm 1.9.1%rails3 |
NewerOlder