- First rule of cohackfest, no client work
- Second rule of cohackfest, NO CLIENT WORK!
(see what I did there?)
“This, after all, is how GitHub was started. Tom and I had full time gigs,
| ['name', 'email', 'website', 'captcha_solution'].each do |field| | |
| it "should show the #{field} field" do | |
| render '/comments/_form' | |
| response.should have_tag("input#comment_#{field}") | |
| end | |
| end |
| def name | |
| commenter.try(:name) || super || "Anonymous Coward" | |
| end | |
| require 'timeout' | |
| class Twitter | |
| def initialize(username, password) | |
| @username = username | |
| @password = password | |
| end | |
| def url | |
| @url ||= URI.parse("http://twitter.com/statuses/update.xml") | |
| end |
| require File.dirname(__FILE__) + '/../spec_helper' | |
| require 'action_controller/integration' | |
| # $:.unshift '/home/rlusk/projects/crm/txnew/test/mocks/test/' | |
| # require "#{File.dirname(__FILE__)}/../test_helper" | |
| # require 'pp' | |
| # require 'action_controller/dispatcher' | |
| # | |
| # x = ActionController::Dispatcher | |
| # module ActionController | |
| # class Dispatcher |
| class MyAccount::PostsController < ApplicationController | |
| before_filter :login_required | |
| def index | |
| @posts = current_user.posts.paginate :page => params[:page], :order => 'created_at DESC' | |
| end | |
| def toggle_visibility | |
| @post = current_user.posts.find params[:id] | |
| @post.toggle!(:visible) |
| def notifications(request) | |
| organization_sfdc_id = params['Envelope']['Body']['notifications']['OrganizationId'] | |
| object_class = params['Envelope']['Body']['notifications']['Notification']['sObject']['xsi:type'].gsub(/sf:/, '') | |
| logger.fatal("organization_sfdc_id: #{organization_sfdc_id}") | |
| logger.fatal("object_class: #{object_class}") | |
| begin | |
| if ['Lead', 'Contact'].include?(object_class) | |
| organization = Organization.find_by_sfdc_id(organization_sfdc_id) | |
| organization.setup | |
| notifications = request.notification |
| RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION | |
| # Bootstrap the Rails environment, frameworks, and default configuration | |
| require File.join(File.dirname(__FILE__), 'boot') | |
| Rails::Initializer.run do |config| | |
| config.gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => 'http://gems.github.com' | |
| config.gem 'right_aws' | |
| # config.log_level = :debug |
| ?? |
| require 'rational' | |
| require 'rubygems' | |
| require 'exifr' rescue nil | |
| module Randy | |
| # converts dms in [Rational(75, 1), Rational(452, 25), Rational(0, 1)] to a float | |
| def self.dms_to_float(dms) | |
| if dms == nil || (dms.size != 3) && !dms.map{|i| i.class == Rational}.all? | |
| raise ArgumentError, "We need an array of 3 Rational numbers. k thx bai." | |
| end |