Skip to content

Instantly share code, notes, and snippets.

View apangeajwrubel's full-sized avatar

Jim Wrubel apangeajwrubel

View GitHub Profile
@apangeajwrubel
apangeajwrubel / gist:4025370
Created November 6, 2012 15:21
Triathletes make great developers

My name is Jim Wrubel - I'm the Chief Technical Officer at Think Through Math, one of Highgroove's clients. In my spare time (such as it is) I'm a long-course triathlete and marathoner. Recently we partnered with Highgroove to rebuild our core e-learning platform. During the process I realized that there are a lot of similarities between training for an endurance event like triathlon and launching a major web initiative.

###The work you put in during the build determines your success in the event. If you haven't put in the time, no amount of last-minute workouts or coding will make up for it. This is something developers know instinctively - unfortunately it's not common knowledge among managers. Also, in product launches and major races, you usually have a specific date that is set in stone. But if you haven't done the work in the months leading up to the event, be prepared for a rough day. Coincidentally, training for an Ironman and developing a significant web app both take about the same amount of effor

module.exports = {
pivotal: {
TOKEN: 'TOKEN'
PID: 'PID',
},
sprintly: {
USER: "USER_EMAIL",
ID: 'PRODUCT_ID',
KEY: 'API_KEY'
},
@apangeajwrubel
apangeajwrubel / gist:4953849
Created February 14, 2013 16:11
our unicorn config
rails_env = ENV['RAILS_ENV'] || 'production'
preload_app true
# number of workers - makes sure this matches memory config
worker_processes Integer(ENV['UNICORN_WORKERS'] || 2)
# restart workers if request takes too long
timeout Integer(ENV['UNICORN_TIMEOUT'] || 25)
# Only allow reasonable backlog of requests per worker
@apangeajwrubel
apangeajwrubel / gist:4438708
Last active December 10, 2015 13:08
Test failures on dbcharmer-horizontal
Unit Tests
Snippet:
ERROR (0.01649s) (11:00:09.365) 0002 can create a snippet with audio from text
Couldn't find Snippet with id=1564
School::shard_name
TODO: fix this test because previously we picked the LAST shard
FAIL (0.01305s) (11:00:08.666) 0001 uses a random shard if this customer doesn't have any other schools
Expected: "enrollments_shard_two"
@apangeajwrubel
apangeajwrubel / gist:4242901
Created December 9, 2012 01:29
Test failures and outcomes
Pathway Reports Integration Test
ERROR (0.00220s) (24:00:22.962) 0001 can get all lesson enrollments for a partially completed enrollment
Couldn't find Pathway with id=254
Message Integration Test::Viewing messages::as a teacher
ERROR (0.64553s) (23:00:05.036) 0001 shouldn't show an error page if there aren't any contest messages
no link or button 'Messages' found
-- This link was commented out for launch. Skip the test for now
@apangeajwrubel
apangeajwrubel / gist:3503792
Created August 28, 2012 20:25
updating version_of_ attributes
std = $stdout
$stdout = File.new('console.out', 'w')
ActiveRecord::Base.logger = nil
Item.published.all.each do |item|
next if (item.active == false)
#item = Item.find_by_item_number_and_state(60124, "Published")
@apangeajwrubel
apangeajwrubel / gist:3398053
Created August 19, 2012 22:05
finding the itemstep ids in an activity
@activity = Activity.find(1085)
@activity.items.each do |item|
p item.item_steps.first.id
end
@apangeajwrubel
apangeajwrubel / gist:3398045
Created August 19, 2012 22:03
fixing students with orphaned attempts
# first one
item_step = Item.find(829).item_steps.first
bad_item_step_id = 829
Attempt.where("attemptable_type = 'ItemStep' and attemptable_id = ?", bad_item_step_id).each do |a|
a.attemptable_id = item_step.id
if a.correct
a.response_id = item_step.correct_responses.first.id
else
a.response_id = item_step.incorrect_responses.first.id
end
@apangeajwrubel
apangeajwrubel / gist:3275901
Created August 6, 2012 15:56
latest flash json
{"language":"en","lessonData":{"fileName":"http://content.thinkthroughmath.com/uploads/image/image/44224/g3_fl1.swf","title":"G3FL1 Place Value with Whole Numbers Lesson","type":"JIT","chapters":[{"activity_id":1385,"title":"Place Value \u2013 Ones and Tens","internal_title":"JIT 1","order":1,"subtitles":[{"chapter_id":1028,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/4604970d-7430-4918-980e-d23d4b9551f7/F4604970d-7430-4918-980e-d23d4b9551f7.mp3"},{"chapter_id":1028,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/218c8a8b-2edd-4b7b-b8b4-be0f4c601e7f/F218c8a8b-2edd-4b7b-b8b4-be0f4c601e7f.mp3"},{"chapter_id":1028,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/f468e9d3-f9b1-4c03-a57c-17ec5c648ce9/Ff468e9d3-f9b1-4c03-a57c-17ec5c648ce9.mp3"}]},{"activity_id":1385,"title":"Comparing Numbers","internal_title":"JIT 2","order":2,"subtitles":[{"chapter_id":1029,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/7b8a2b21-dbdc-4575-9573-c83bf7c2846c/F7b8a2b21-dbdc-
@apangeajwrubel
apangeajwrubel / gist:3212653
Created July 31, 2012 01:47
adding position to Hints on ItemSteps
@item_steps = ItemStep.all
@item_steps.each do |item_step|
item_step.hints.each_with_index do |hint, index|
hint.position = index
hint.save
end
end