Skip to content

Instantly share code, notes, and snippets.

View gustavowt's full-sized avatar

Gustavo Warmling Teixeira gustavowt

View GitHub Profile
box: wercker/ubuntu12.04-ruby2.0.0
services:
- wercker/postgresql
build:
steps:
- bundle-install
- rails-database-yml:
service: postgresql
- script:
name: rake
@paveltyk
paveltyk / mock_geocoder.rb
Created October 10, 2011 14:48
Geocoder: Stub out address geocoding during RSpec unit tests
# In spec_helper:
# RSpec.configure do |config|
# ...
# config.include(MockGeocoder)
# end
#
# In your tests:
# it 'mock geocoding' do
# mock_geocoding! # You may pass additional params to override defaults (i.e. :coordinates => [10, 20])
# address = Factory(:address)
@superp
superp / gist:888384
Created March 26, 2011 15:38
Publish stream in Facebook & Twitter with OmniAuth
# models/person.rb
serialize :auth_hash, Hash
def facebook
@fb_user ||= FbGraph::User.me(user_attributes[:token])
end
def twitter
@tw_user ||= prepare_access_token(user_attributes[:token], user_attributes[:secret])
end
@mrrooijen
mrrooijen / carrierwave_tasks.rb
Created June 2, 2010 00:27
Rake Tasks for Carrier Wave for reprocessing versions.
##
# CarrierWave Amazon S3 File Reprocessor Rake Task
#
# Written (specifically) for:
# - CarrierWave
# - Ruby on Rails 3
# - Amazon S3
#
# Works with:
# - Any server of which you have write-permissions in the Rails.root/tmp directory