This file contains hidden or 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
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run "rm -f public/javascripts/*" | |
This file contains hidden or 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
def get_random_number | |
return 4 //chosen by fair dice roll. | |
//guaranteed to be random. | |
end |
This file contains hidden or 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
# recreates all file_column images in all needed sizes | |
class ImageUpdater | |
def update_all | |
update_model(:video, :image) | |
update_model(:photo, :image) | |
end | |
private | |
This file contains hidden or 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
Second line in view: | |
Expected: /artikelen/frontpage/123 | |
Got: /articles/123?section_slug=frontpage |
This file contains hidden or 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
/* ------------------------------------------------------------------------------------------------- | |
It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after | |
this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs. | |
This will allow you to update formtastic.css with new releases without clobbering your own changes. | |
This stylesheet forms part of the Formtastic Rails Plugin | |
(c) 2008 Justin French | |
--------------------------------------------------------------------------------------------------*/ |
This file contains hidden or 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
%! program = pdflatex | |
\documentclass[9pt,twoside,pageany]{memoir} | |
% Sets the papersize. | |
% \settrimmedsize{4.25in}{6.875in}{*} | |
% Sets the papersize. | |
\setstocksize{17.463cm}{10.795cm} |
This file contains hidden or 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
# Use ApiKey.generate to generate a new API key | |
class ApiKey < ActiveRecord::Base | |
validates_presence_of :key | |
validates_uniqueness_of :key | |
def self.generate(description = "No description") | |
key = Digest::SHA1.hexdigest("--#{Time.now}--#{description}--") | |
ApiKey.create(:description => description, :key => key) | |
end |
This file contains hidden or 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 little nugget will remove an existing rake task. This allows you to | |
# redefine tasks. | |
# | |
# remove_task :test | |
# task :test => [:spec, :features] | |
# | |
Rake::TaskManager.class_eval do | |
def remove_task(task_name) | |
@tasks.delete(task_name.to_s) | |
end |
This file contains hidden or 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
You must be using git and capistrano to deploy your app. Capistrano will place a file in your Rails.root named 'REVISION'. Tested with the following capistrano setting: | |
set :scm, :git | |
set :deploy_via, :remote_cache |
This file contains hidden or 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 Rails 2.3.x template will create a new git-based Rails project | |
# with Cucumber, RSpec and Remarkable pre-installed and ready to go. | |
# | |
# (C) 2009 under the MIT License by Ariejan de Vroom <[email protected]> | |
# | |
# USAGE: | |
# rails -d mysql -m http://gist.github.com/181167.txt APP_NAME | |
# Delete unnecessary files |