Skip to content

Instantly share code, notes, and snippets.

View livando's full-sized avatar

Don Livanec livando

View GitHub Profile
@netzpirat
netzpirat / env.rb
Created November 18, 2009 19:22
Cucumber ActiveResource faking
require 'fakeweb'
require 'fake_resource'
ActiveResource::Base.send :include, ActiveResource::FakeResource
Before do
FakeWeb.allow_net_connect = false
end
After do |scenario|
ActiveResource::FakeResource.clean
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@ahoward
ahoward / a.rb
Created May 8, 2012 16:06
did i mention style is everything?
#
# perl got some things right. here-docs were one of them. YAML takes this
# further when we have to define large data structures.
#
# if you find yourself typing " ' ) ( [ ] too many times in a row, whack
# yourself on the wee-wee with a keyboard and whip out the YAML
#
this_fucking_licks_hairy_balls_to_edit =
@evanbeard
evanbeard / registrations_controller.rb
Created May 11, 2012 19:53 — forked from jwo/registrations_controller.rb
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@peter
peter / creating-edgerails-app.sh
Created June 30, 2012 21:03
Creating and Deploying an EdgeRails (Rails 4) Application to Heroku
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
@seratch
seratch / config.yml
Created October 25, 2012 09:37
AWS SQS Example
access_key_id: xxx
secret_access_key: yyy
@livando
livando / devise_msgs.rb
Created November 16, 2012 14:40
Pull Devise messages from YAML
msgs = YAML::load(File.open("#{::Rails.root.to_s}/config/locales/devise.en.yml"))
 
msgs['en']['devise']['failure']['unauthenticated']
@mutewinter
mutewinter / Alfred 3 Workflows.md
Last active November 25, 2020 14:14
A list of Alfred 3 workflows I'm using.