Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/new_relic/control/frameworks/rails3.rb b/lib/new_relic/control/
index f09cbf1..0199070 100644
--- a/lib/new_relic/control/frameworks/rails3.rb
+++ b/lib/new_relic/control/frameworks/rails3.rb
@@ -20,7 +20,9 @@ module NewRelic
def root
value = ::Rails.root.to_s
if value.empty?
- super
+ ActiveSupport::Deprecation.silence do

A PC Capable of playing Skyrim on 'High' settings.

Prices from msy.com.au as at 2011-11-11.

  • AM3 x4 965: $138
  • 8GB KIT 1333 DDR3 TRANSCEND/G.SKILL: $40
  • AsRock 880GM-LE Motherboard: $67
  • 1GB ATI 6870 Powercolor GPU: $170
  • HITACHI DESKTAR 1TB: $104 (note: HDD prices are really high right now, may want to use a spare)
  • Thermaltake Wing V3 Case: $73
def self.tipo_texto
0
end
def self.tipo_flash
1
end
def self.tipo_audio
2
end
module ActiveSupport
module Inflector
alias :humanize_orig :humanize
def humanize *args
humanize_orig(*args) + ' eh?'
end
end
end
def subdomain
@subdomain ||= begin
parts = begin
if @request.host.ends_with?('.au')
@request.subdomains(2)
else
@request.subdomains(1)
end
end
parts.first == 'www' ? parts[1] : parts[0]
@mipearson
mipearson / GIVING_A_TALK.md
Created December 14, 2011 23:09
Prerequisites For Giving a Presentation at a User's Group

Prerequisites For Giving a Presentation at a User's Group

You've decided to get up in front of a bunch of strangers and talk about a topic for thirty to fifty minutes. You're going to convey your unique, personal experience and everybody is going to afterwards feel as if they've learned something new.

For most talks at user groups, this doesn't happen, and it's easily fixable.

You absolutely, no questions asked, need to:

  • Know what you're presenting: rehearse it to yourself, once, out loud. If that's too awkward for you it's going to be more awkward when you're back-pedalling and skipping sections in front of thirty to fifty of your peers. If you have demonstration content, test it from beginning to end, especially the bits that you assume will 'just work'.

benchmark.rb Demonstration On a Modern System

The rdoc for the Benchmark module contains the following snippet:

require 'benchmark'

puts Benchmark.measure { "a"*1_000_000 }

# On my machine (FreeBSD 3.2 on P5, 100MHz) this generates:
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb
index 9504b65..f84d8bf 100644
--- a/railties/guides/rails_guides/generator.rb
+++ b/railties/guides/rails_guides/generator.rb
@@ -129,7 +129,16 @@ module RailsGuides
def initialize_dirs(output)
@guides_dir = File.join(File.dirname(__FILE__), '..')
@source_dir = "#@guides_dir/source/#@lang"
- @output_dir = output || "#@guides_dir/output/#@lang"
+ @output_dir = if output
# Is there a better way to perform the below?
var = begin
if herp
'derp'
elsif qux
'baz'
else
'foo'
end
@mipearson
mipearson / Gemfile
Created January 1, 2012 12:07
Getting Livereload 1.x working with compass and Rails 3.0 with no asset pipeline
group :development do
gem 'guard-livereload', :require => false
gem 'guard-compass', :require => false
gem 'yajl-ruby', :require => false
end