Skip to content

Instantly share code, notes, and snippets.

View raine's full-sized avatar

Raine Virta raine

View GitHub Profile
@raine
raine / .bash_profile
Created June 16, 2011 20:25
git bash prompt
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
@raine
raine / factories.rb
Created June 16, 2011 20:59
spec/support/sessions_helper.rb
Factory.define :user do |u|
u.email 'user@example.com'
u.first_name 'Mike'
u.last_name 'Baxter'
u.password 'test123'
end
require "rake"
@rake = Rake::Application.new
Rake.application = @rake
Rake.application.rake_require "tasks/cron"
Rake::Task.define_task(:environment)
@rake['cron'].invoke
@raine
raine / git-bash-aliases.bash
Created June 25, 2011 13:13
git bash aliases
alias gdc='git diff --cached'
alias gst='git status -s' # git >1.7.0
alias glr='git pull --rebase'
alias gl='git pull'
alias gp='git push'
alias gd='git diff'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gb='git branch'
alias gba='git branch -a'
require 'spec_helper'
describe User do
it "should create a new user given a username" do
User.create!(:username => "rmcenroe")
end
it "should not create a new user given a bad username" do
bad_user = User.new(:username => "not_real")
bad_user.should_not be_valid
it 'should create a new ApplicationVersion with correct attributes' do
# uncommenting line below causes the @app.application_versions return [] making the test fail; ???
# @app.application_versions.should be_empty
FakeFS do
expect { process_bundle }.to change(ApplicationVersion, :count).by(1)
end
av = @app.application_versions.first
av.version.should == @version
it 'should create a new ApplicationVersion with correct attributes' do
# uncommenting line below causes the @app.application_versions return [] making the test fail; ???
# @app.application_versions.should be_empty
FakeFS do
expect { process_bundle }.to change(ApplicationVersion, :count).by(1)
end
av = @app.application_versions.first
av.version.should == @version
devise_for :users,
:controllers => { :registrations => 'registrations', :confirmations => 'confirmations' },
:path_names => { :sign_in => 'login', :sign_up => 'signup', :sign_out => 'logout' }
devise_scope :user do
get 'signup', :to => 'registrations#new'
get 'login', :to => 'devise/sessions#new'
end
nnoremap <F5> :silent! let &guifont = substitute(
\ &guifont,
\ ':h\zs\d\+',
\ '\=eval(submatch(0)+1)',
\ '')<CR>
nnoremap <F4> :silent! let &guifont = substitute(
\ &guifont,
\ ':h\zs\d\+',
\ '\=eval(submatch(0)-1)',
\ '')<CR>
$ ->
return unless $('#pages_home').length
$(window).blur ->
disableLoop()
$(window).focus ->
enableLoop() if not window.cInt?
fadeDuration = 1000
items = ($ elem for elem in $ '.right')