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
for f in *; do mv $f ${f/erb/haml}; done |
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
def google_font_link_tag(family) | |
tag('link', {:rel => :stylesheet, :type => Mime::CSS, :href => "http://fonts.googleapis.com/css?family=#{family}"}, false, false) | |
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
class Things < ActiveRecord::Base | |
def massive_calculation | |
@massive_calc_results ||= self.execute_massive_sql | |
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
[ODBC Data Sources] | |
dsn_name = tds | |
[ODBC] | |
Trace = 1 | |
TraceAutoStop = 0 | |
TraceFile = /Users/whatever/Desktop/odbc.log | |
TraceLibrary = | |
[dsn_name] |
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
# encoding: utf-8 | |
# | |
# column_box.rb: Extends BoundingBox to allow for columns of text | |
# | |
# Author Paul Ostazeski. | |
require "prawn/document/bounding_box" | |
module Prawn | |
class Document |
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
alias_attribute :administrator :IsAdministrator | |
alias_attribute :consumer :IsConsumer | |
# etc... | |
# now you can do checks like: | |
if @user.administrator? | |
# and if you need .role: |
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
# Rails.root/lib/tasks/test.rake | |
Rake.application.remove_task 'db:test:prepare' | |
namespace :db do | |
namespace :test do | |
task :set_env do | |
end | |
task :prepare => [:set_env, :environment] do |t| |
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
# | |
# Custom error classes that extend Exception don't get caught by catch-all/bare rescue statements. | |
# | |
class ExtendsStandardError < StandardError; end | |
class ExtendsException < Exception; end | |
begin | |
raise ExtendsStandardError, "Burn." |
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
[97, 106] in /Users/jonc/code/innova/renewadvantage/vendor/ruby/1.9.1/gems/actionpack-3.2.1/lib/abstract_controller/rendering.rb | |
97 end | |
98 | |
99 # Raw rendering of a template to a Rack-compatible body. | |
100 # :api: plugin | |
101 def render_to_body(options = {}) | |
=> 102 _process_options(options) | |
103 _render_template(options) | |
104 end | |
105 |
OlderNewer