Skip to content

Instantly share code, notes, and snippets.

View seejee's full-sized avatar

Chris Geihsler seejee

View GitHub Profile
@seejee
seejee / gist:1330437
Created November 1, 2011 12:42
Don't obsess over primitives...
TimeSpan timeToTravel = 50.Millimeters() / 8.MetersPerSecond();
@seejee
seejee / signup.txt
Created March 11, 2012 15:44
Mendicant WebDev 3 Project Signup (tentative)
Project 1: Shane Emmons, Brent Vatne
Project 2: Justin Ramel, Gonzalo Rodríguez-Baltanás Díaz
Project 3: Gregory Brown, Jia Brown
Project 4:
Project 5: Chris Geihsler
Project 6:
@seejee
seejee / liskov_explanation.html
Created March 14, 2012 01:39
Liskov philosophy and structure
<html class="normal" type="channel" channelname="#mendicant-webdev-3"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Script-Type" content="text/javascript"><meta http-equiv="Content-Style-Type" content="text/css"><style>html {font-family:'Courier';font-size:9pt;background-color:white;color:black;word-wrap:break-word;margin:0;padding:3px 4px 10px 4px;}body {margin:0;padding:0}img {border:1px solid #aaa;vertical-align:top;}object {vertical-align:top;}hr {margin:0.5em 2em;}.line {margin:0 -4px; padding:0 4px 1px 4px; clear:both;}.line[alternate=even] {}.line[alternate=odd] {}.line[type=action] .sender:before {content: '• ';white-space: nowrap;}.inlineimage {margin: 10px 0 15px 40px;max-width: 200px;max-height: 150px;-webkit-box-shadow: 2px 2px 2px #888;}.avatar {display: inline;max-width: 24px;max-height: 24px;margin-right: 3px;vertical-align: middle;}.url { word-break: break-all; }.address { text-decoration: underline; word-break: break-all; }.highlight { colo
@seejee
seejee / student_page_test.rb
Created March 25, 2012 15:18
student page task assertion
require "test_helper"
describe "Student Page Integration" do
before do
@course = FactoryGirl.create(:webdev)
@student = build_person(:student, @course)
end
it "should display all of the course tasks on the student page" do
$ rspec
user system total real
no turbolinks 1.670000 0.220000 1.890000 ( 23.714543)
yes turbolinks 1.450000 0.100000 1.550000 ( 18.947022)
no turbolinks 1.420000 0.130000 1.550000 ( 21.182031)
yes turbolinks 1.460000 0.120000 1.580000 ( 18.899599)
$ rspec
user system total real
yes turbolinks 1.730000 0.220000 1.950000 ( 21.837095)
@seejee
seejee / gist:4639478
Created January 26, 2013 01:27
No shard spanning
def create_demo_pathway(lesson_id)
grade_level = GradeLevel.first.id
state = State.find_by_code!('PA')
lesson = Lesson.find(lesson_id)
pathway = Pathway.create!(
name: 'Demo Pathway',
grade_level_id: grade_level,
state: state,
Pathway.create uses the wrong shard:
Loading development environment (Rails 3.2.11)
1.9.3-p327 :001 > RequestStore.store[:shard_name] = "enrollments_shard_one"
=> "enrollments_shard_one"
1.9.3-p327 :002 > current_user = User.find(99)
User Load (4.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 99]]
=> #<User id: 99, email: "rondo-custadmin@thinkthroughmath.com", encrypted_password: "$2a$10$7enmwB6QbwEjp9Ae6mjC4O3iySBxU3UBEIEeJxzw84hb...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 9, current_sign_in_at: "2013-01-15 16:37:02", last_sign_in_at: "2012-12-21 18:28:36", current_sign_in_ip: "204.16.243.194", last_sign_in_ip: "204.16.243.194", created_at: "2012-08-01 16:44:01", updated_at: "2013-01-15 16:37:02", role: "customer admin", username: nil, first_name: "Ryan", last_name: "Ondo", max_students: nil, nickname: nil, second_language: nil, state_id: nil, invitation_accepted_at: nil, invitation_token: nil, account_sponsor_emai
require 'test_helper'
describe Pathway do
let(:user) { create(:content_admin) }
let(:state) { create(:state) }
let(:grade_level_id) { GradeLevel.first.id }
describe 'when not setting a shard' do
it 'should raise an error ' do
Loading development environment (Rails 3.2.11)
1.9.3-p327 :001 > user = User.find(6)
User Load (4.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 6]]
=> #<User id: 6, email: "teacher@example.com", encrypted_password: "$2a$10$tCfwHNgdfElvY/7MV49hIev5e3Zj8D7K/dUttQwtQ7gf...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 121, current_sign_in_at: "2013-01-22 22:34:15", last_sign_in_at: "2013-01-14 21:37:26", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "204.16.243.194", created_at: "2012-07-18 18:46:44", updated_at: "2013-01-22 22:34:15", role: "teacher", username: nil, first_name: "Seeded", last_name: "Teacher", max_students: nil, nickname: nil, second_language: nil, state_id: nil, invitation_accepted_at: nil, invitation_token: nil, account_sponsor_email: nil, account_sponsor_name: nil, active: true, zip_code: nil, phone_number: nil, street_address: nil, city: nil, ip_address: nil, school_district_provider_id: nil>
1.9.3-p32
@seejee
seejee / gist:4673872
Last active December 11, 2015 22:59
Gist for next prod deployment
After push:
heroku config:set BUNCHBALL_CONCURRENCY=50 -a ttm-production