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
# download, from_repo, and commit_state methods swiped from | |
# http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb | |
require 'open-uri' | |
def download(from, to = from.split("/").last) | |
#run "curl -s -L #{from} > #{to}" | |
file to, open(from).read | |
rescue | |
puts "Can't get #{from} - Internet down?" |
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 PurgePostCategories < ActiveRecord::Migration | |
@posts = [3,6,9,10,11,14,15,19,23,24,38,40,42,65,66,70,71,103,106,107,108,109,197,198,199,200,201] | |
c = Category.find_by_title('Useful') | |
def self.up | |
@posts.each do |post| | |
Post.find(post).categories.delete(c) | |
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
@posts = [3,6,9,10,11,14,15,19,23,24,38,40,42,65,66,70,71,103,106,107,108,109,197,198,199,200,201] | |
@posts.each { |post| Post.find(post).categories.delete( Category.find 3 ) } | |
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
In Use: | |
Devise | |
CanCan | |
Kaminari | |
friendly_id | |
Papertrail | |
Carrierwave | |
Rails Best Practices | |
Rails Footnotes | |
Guard |
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
brew install -f imagemagick --disable-openmp |
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
guard 'bundler' do | |
watch('Gemfile') | |
end | |
guard 'cucumber' do | |
watch(%r{^features/.+\.feature$}) | |
watch(%r{^features/support/.+$}) { 'features' } | |
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' } | |
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
module ActionView | |
module Helpers | |
module AssetTagHelper | |
def stylesheet_path(source) | |
compute_public_path(source, "stylesheets/<some sub dir here>", 'css') | |
end | |
alias_method :path_to_stylesheet, :stylesheet_path | |
def image_path(source) |
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
# A limited way to interact with the Heroku API. | |
# | |
# INSTALLATION: | |
# 1. Create file in scripts folder in hubot folder | |
# 2. Update package.json for hubot and add dependency on "sprintf": "0.1.1" | |
# 3. Set heroku config variable HEROKU_USER to heroku user account to use | |
# 4. Set heroku config variable HEROKU_APIKEY to heroku user account apikey (from My Account page) | |
# | |
# heroku status - Retrieve the most recent tweet from the @herokustatus account | |
# heroku ps --app <appname> - Get process information for application |
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
GIT | |
remote: git://github.com/jnicklas/carrierwave.git | |
revision: 181620a505b45e1a9b919278a213036a4fd7c89f | |
specs: | |
carrierwave (0.5.8) | |
activesupport (>= 3.0) | |
GEM | |
remote: http://rubygems.org/ | |
specs: |
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
Loading development environment (Rails 3.2.0.rc2) | |
>> Photo.last | |
Photo Load (0.9ms) SELECT "photos".* FROM "photos" ORDER BY "photos"."id" DESC LIMIT 1 | |
#<Photo:0x007fabb4fb0da8> { | |
:id => 15, | |
:user_id => 1, | |
:yacht_id => 11, | |
:image => "DSCF2077.jpeg", | |
:primary => false, | |
:created_at => Fri, 30 Dec 2011 09:16:48 UTC +00:00, |
OlderNewer