Skip to content

Instantly share code, notes, and snippets.

View ryanbrunner's full-sized avatar

Ryan Brunner ryanbrunner

  • Supercast
  • Toronto, Ontario
View GitHub Profile
def test
"blah"
end
@ryanbrunner
ryanbrunner / mail_header.rb
Created March 2, 2012 14:57
Trying to set mail headers on existing Mail::Message
m = MailSender.template_email(Contact.first, :email => Email.last)
#<Mail::Message:70134218883740, Multipart: false, Headers: <From: admin@influitive.com>, <To: ryan+432i840329@ryanbrunner.com>, <Subject: Invitation to join Influitive's Community>, <Mime-Version: 1.0>, <Content-Type: text/html>>
# Trying to set the headers property...
m.headers # {}
# This doesn't seem to have any effect on the headers
m.headers["Blah"] = "Blah"
@ryanbrunner
ryanbrunner / should_receive_spec.rb
Created April 2, 2012 22:00
should_not_receive doesn't work when any_instance is used.
class Foo
def bar
puts "bar!"
end
end
describe Foo do
# This test will pass with rspec 2.9.0. An instance of Foo is receiving bar,
# so shouldn't it fail?
@ryanbrunner
ryanbrunner / gist:2492851
Created April 25, 2012 19:52 — forked from thommahoney/gist:2491946
RailsConf 2012 Lightning Talks
5 min:
~Objective-C + Rails:
Communicating w/rails from iOS/mac OS
Dan Hassin
1 min:
~Painless Javascript
koting hatduklgg
with wind tunnel
@ryanbrunner
ryanbrunner / challenge_data.rb
Created September 26, 2012 16:06
Pull challenge data.
require 'csv'
output = CSV.generate do |csv|
Database.all_tenants do |db|
Challenge.includes({:visibility => :groups}, :activities).list.each{|c|
csv << [
db,
c.id,
c.visibility.membership,
@ryanbrunner
ryanbrunner / gist:55e335bf34ee52c82c78
Last active August 29, 2015 14:06
Custom CSS Testing
body {
background-color: black !important;
font-size: 24px !important;
font-family: "Comic Sans" !important;
}
body {
background-color: black !important;
}
@ryanbrunner
ryanbrunner / gist:22b14a368f047248b90a
Created December 12, 2014 20:15
Lotus Model problem
require 'lotus-model'
require 'lotus/model/adapters/memory_adapter'
module Admin
module Models
class Feature
include Lotus::Entity
self.attributes = :name
end

Week 1, Day 1: Ruby, The Interwebs and YOU (but mainly Ruby & the interwebs)

Materials Required / Prep Work

  1. Opening a 'command-line' interpreter
  2. RVM (osx only), Ruby & Ruby-gems installed
  3. A Text Editor (Sublime Text strong recommended)
  4. Have the command line cheatsheet handy

Week 1, Day 2: Ruby and Git

Materials Required / Prep Work

  1. Make sure you have Git installed on your computer. If you don't, here's a guide to getting it setup - http://git-scm.com/downloads.
  2. If you haven't already, create an account on GitHub.
  3. Install the Heroku toolbelt, and set up an account on Heroku.