Most of the time, when we talk about the economy, we hear that we need to 'rein in spending', that we need to trim our expenses. But it's relatively rare that we hear anything about growing our economy, except as part of the 'cut taxes' refrain. Do you think we ought to be more concerned with growing, rather than pruning? If yes, what steps as our MP would you take to help our economy flourish? Finally, how would you guarantee that the economic growth would go toward helping low- and middle-class families, rather than wallpapering executives' houses?
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
class EventsController < ApplicationController | |
before_filter :find_all_events | |
before_filter :find_page | |
def index | |
# you can use meta fields from your model instead (e.g. browser_title) | |
# by swapping @page for @event in the line below: | |
present(@page) | |
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
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: @(#)PROGRAM:Install PROJECT:Install-684 | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: @(#)PROGRAM:Installer PROJECT:Installer-530 | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Hardware: iMac11,2 @ 3.06 GHz (x 4), 4096 MB RAM | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Running OS Build: Mac OS X 10.7 (11A511) | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Env: PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Env: TMPDIR=/var/folders/6q/_3ryf5yj0q917628qn45xmt00000gn/T/ | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Env: SHELL=/bin/bash | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Env: HOME=/Users/rob | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Env: USER=rob | |
Aug 2 11:47:41 Rob-Yurkowskis-iMac Installer[4002]: Env: LOGNAME=rob |
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
== AddTranslationTableToBlog: migrating ====================================== | |
rake aborted! | |
An error has occurred, this and all later migrations canceled: | |
Bad field type for field :custom_title (nil), should be :string or :text | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:101:in `block in validate_translated_fields' | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:99:in `each' | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:99:in `validate_translated_fields' | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:29:in `create_translation_table!' |
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
# Globalizing an Engine: | |
# app/views/<model>.rb | |
#- add "require 'globalize3'" | |
#- In class definition: | |
#- Remove 'is_seo_meta if self.table_exists?' | |
#- Add following: | |
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
#retrive a number between 1 and another value - varUpper | |
# R: In Ruby, we strive for legibility. varUpper is an okay variable name, but an even better one would be upper_limit (var is implied by the fact it's a var, and Upper isn't clear as to what it refers). | |
upper_limit = 100 | |
# R: This is one way to do a string, with single quotes. There are also a couple of alternatives, but the primary one is this: | |
# Double quotes let you put variables in a string in between #{} -- this will also automatically call .to_s. | |
puts "Welcome to Keith's Prime Number Checker. Please enter an integer between one and #{upper_limit}" | |
# R: We'll name this something more verbose, too: |
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
class OfflineMessages < IRCClient | |
def initialize | |
add_hook(:join) { |m| send_message( m[:user] ) } | |
add_hook(:command) { |m| route m[:target], m[:user], m[:command] } | |
end | |
def route(target, user, command) | |
if /\Atell/i.match user command | |
save_message(user, command) |
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
# cat /var/log/apache2/error.log | tail -n 2 | |
[Sun May 17 02:46:11 2009] [error] [client xxx.xxx.xxx.xxx] | |
Symbolic link not allowed or link target | |
not accessible: /var/www/wedding | |
[Sun May 17 02:51:18 2009] [error] [client xxx.xxx.xxx.xxx] | |
Symbolic link not allowed or link target | |
not accessible: /var/www/chat |
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
powder/ruby/1.9.1/bin/erubis | |
powder/ruby/1.9.1/bin/haml | |
powder/ruby/1.9.1/bin/html2haml | |
powder/ruby/1.9.1/bin/rackup | |
powder/ruby/1.9.1/bin/rails | |
powder/ruby/1.9.1/bin/rake | |
powder/ruby/1.9.1/bin/rake2thor | |
powder/ruby/1.9.1/bin/rdoc | |
powder/ruby/1.9.1/bin/ri | |
powder/ruby/1.9.1/bin/sass |
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
class RegistrationController < ApplicationController | |
before_filter :find_user | |
def create | |
if @user.save | |
add_reminders_to @user | |
else | |
render :new, :errors => "Something weird" | |
end | |
end |