Skip to content

Instantly share code, notes, and snippets.

View robyurkowski's full-sized avatar

Rob Yurkowski robyurkowski

View GitHub Profile
@robyurkowski
robyurkowski / question.markdown
Created April 21, 2011 05:59
Question for Regina Palliser Candidates

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?

@robyurkowski
robyurkowski / events_controller.rb
Created August 1, 2011 07:14
content_for :body_content_side does not show up...
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
@robyurkowski
robyurkowski / phonegap_install.log
Created August 2, 2011 17:48
Phonegap install issues
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
@robyurkowski
robyurkowski / Error Result
Created September 1, 2011 05:19
Funky Times with Globalize3
== 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!'
@robyurkowski
robyurkowski / globalizing.rb
Created September 28, 2011 21:10
Globalizing an Engine -- rough notes
# Globalizing an Engine:
# app/views/<model>.rb
#- add "require 'globalize3'"
#- In class definition:
#- Remove 'is_seo_meta if self.table_exists?'
#- Add following:
@robyurkowski
robyurkowski / PrimeNoV2.rb
Created September 29, 2011 19:17 — forked from anonymous/PrimeNoV2
Prime number checker
#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:
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)
@robyurkowski
robyurkowski / apache2-logs.log
Created November 13, 2011 09:10
apache2 logs
# 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
@robyurkowski
robyurkowski / filelist.txt
Created December 14, 2011 20:18
Weird unpacking issue
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
class RegistrationController < ApplicationController
before_filter :find_user
def create
if @user.save
add_reminders_to @user
else
render :new, :errors => "Something weird"
end
end