Skip to content

Instantly share code, notes, and snippets.

View jesscanady's full-sized avatar

Jessica Canady jesscanady

View GitHub Profile

Keybase proof

I hereby claim:

  • I am joncanady on github.
  • I am joncanady (https://keybase.io/joncanady) on keybase.
  • I have a public key ASCD6q9P0mbJ48zmq-jchVo52l2xo2gjL_m-FMSyZuvj8go

To claim this, I am signing this object:

@jesscanady
jesscanady / README.md
Created December 21, 2015 15:48
Columbus.rb December Meeting

So, you've likely heard that we're trying a new location for the Columbus Ruby Brigade meeting! CoverMyMeds has offered to sponsor, and we'd like to give their space a shot.

tl;dr

Show up at the CoverMyMeds offices (floor 11) on December 21. There's free parking in a garage, food, and drinks (including beer).

When

The day isn't changing. Still the third Monday of the month. This one's Dec 21 2015.

@jesscanady
jesscanady / keybase.md
Created March 21, 2014 13:14
Keybase Proof

Keybase proof

I hereby claim:

  • I am joncanady on github.
  • I am joncanady (https://keybase.io/joncanady) on keybase.
  • I have a public key whose fingerprint is FE37 0AFC ED4B CBFA EBAB F339 061C 7E88 94F8 D7EA

To claim this, I am signing this object:

@jesscanady
jesscanady / deploy.rb
Created May 8, 2012 17:30
Deploy scripts!
# in config/deploy.rb
set :default_stage, 'staging'
require 'capistrano/ext/multistage'
require 'bundler/capistrano'
set :application, "appname"
set :repository, "ssh://servername/path/to/repository.git"
set :use_sudo, false
--- a/config/navigation.rb
+++ b/config/navigation.rb
@@ -77,7 +77,7 @@ SimpleNavigation::Configuration.run do |navigation|
when 'Administrator'
primary.item :users, 'Users', users_path, :highlights_on => :subpath do |users|
users.dom_class = 'nav nav-tabs users'
- if !@user.nil? and !@user.new_record?
+ if @user.present?
users.item :notes, 'Notes', user_notes_path(@user)
users.item :claims, 'Claims', user_claims_path(@user), :if => Proc.new{ @user.user_role.IsConsumer == 1 }
@jesscanady
jesscanady / gist:2228179
Created March 28, 2012 16:57
Deep in the debugger...
[97, 106] in /Users/jonc/code/innova/renewadvantage/vendor/ruby/1.9.1/gems/actionpack-3.2.1/lib/abstract_controller/rendering.rb
97 end
98
99 # Raw rendering of a template to a Rack-compatible body.
100 # :api: plugin
101 def render_to_body(options = {})
=> 102 _process_options(options)
103 _render_template(options)
104 end
105
@jesscanady
jesscanady / exception_test.rb
Created January 18, 2012 19:35
Custom errors that extend "Exception" don't get caught by bare rescue statements.
#
# Custom error classes that extend Exception don't get caught by catch-all/bare rescue statements.
#
class ExtendsStandardError < StandardError; end
class ExtendsException < Exception; end
begin
raise ExtendsStandardError, "Burn."
@jesscanady
jesscanady / test.rake
Created October 11, 2011 21:16
Running "rake" doesn't clobber your testing db anymore!
# Rails.root/lib/tasks/test.rake
Rake.application.remove_task 'db:test:prepare'
namespace :db do
namespace :test do
task :set_env do
end
task :prepare => [:set_env, :environment] do |t|
@jesscanady
jesscanady / gist:1278850
Created October 11, 2011 17:58
Completely untested legacy bitfield-based role system fixer.
alias_attribute :administrator :IsAdministrator
alias_attribute :consumer :IsConsumer
# etc...
# now you can do checks like:
if @user.administrator?
# and if you need .role:
# encoding: utf-8
#
# column_box.rb: Extends BoundingBox to allow for columns of text
#
# Author Paul Ostazeski.
require "prawn/document/bounding_box"
module Prawn
class Document