Skip to content

Instantly share code, notes, and snippets.

View jakesorce's full-sized avatar

Jake Sorce jakesorce

View GitHub Profile
@jakesorce
jakesorce / gist:5390094
Created April 15, 2013 18:14
paginating zendesk tickets
view = @client.views.find(:id => view_id)
rows = view.rows.page(1).per_page(100)
while rows.any?
rows.each do |row|
ticket = @client.tickets.find(:id => row.ticket.id)
#do something with the ticket
end
rows.next
end
@jakesorce
jakesorce / gist:5421384
Created April 19, 2013 16:11
clare portal error
uninitialized constant PageView::EventStream /home/hudson/canvas-lms/vendor/plugins/analytics/lib/analytics/extensions/page_view.rb:22:in `block in <top (required)>' /home/hudson/canvas-lms/vendor/plugins/analytics/lib/analytics/extensions/page_view.rb:1:in `class_eval' /home/hudson/canvas-lms/vendor/plugins/analytics/lib/analytics/extensions/page_view.rb:1:in `<top (required)>' /home/hudson/canvas-lms/vendor/plugins/analytics/lib/analytics/extensions.rb:4:in `<top (required)>' /home/hudson/canvas-lms/vendor/plugins/analytics/init.rb:19:in `block (2 levels) in evaluate_init_rb' /home/hudson/canvas-lms/config/environment.rb:23:in `<top (required)>' Tasks: TOP => db:migrate => environment (See full trace by running task with --trace)
"{\n \"kind\": \"calendar#freeBusy\",\n \"timeMin\": \"2013-06-07T22:08:20.000Z\",\n \"timeMax\": \"2013-06-07T22:45:00.000Z\",\n \"calendars\": {\n \"instructure.com_3336383934393632323839@resource.calendar.google.com\": {\n \"busy\": []\n },\n \"instructure.com_35353435363634322d353735@resource.calendar.google.com\": {\n \"busy\": [\n {\n \"start\": \"2013-06-07T22:08:20Z\",\n \"end\": \"2013-06-07T22:45:00Z\"\n }\n ]\n },\n \"instructure.com_2d3433363235383239373538@resource.calendar.google.com\": {\n \"busy\": [\n {\n \"start\": \"2013-06-07T22:08:20Z\",\n \"end\": \"2013-06-07T22:30:00Z\"\n }\n ]\n },\n \"instructure.com_34323832363030373531@resource.calendar.google.com\": {\n \"busy\": [\n {\n \"start\": \"2013-06-07T22:08:20Z\",\n \"end\": \"2013-06-07T22:45:00Z\"\n }\n ]\n },\n \"instructure.com_2d38353538383937372d353232@resource.calendar.google.com\": {\n \"busy\": [\n {\n \"start\": \"2013-06-07T22:08:20Z\",\n \"end\": \"
@jakesorce
jakesorce / update_users.rb
Created June 10, 2013 20:17
update all users in the database to have workflow state of active
def update_users
Users.each { |user| user.update_attribute(:workflow_state, 'active') }
end
@jakesorce
jakesorce / gist:5759152
Created June 11, 2013 17:56
libxml error
Could not open library 'xmlsec1-openssl': dlopen(xmlsec1-openssl, 5): image not found.
Could not open library 'libxmlsec1-openssl.dylib': dlopen(libxmlsec1-openssl.dylib, 5): Library not loaded: /usr/local/opt/libxml2/lib/libxml2.2.dylib
Referenced from: /usr/local/lib/libxmlsec1-openssl.dylib
Reason: Incompatible library version: libxmlsec1-openssl.dylib requires version 12.0.0 or later, but libxml2.2.dylib provides version 11.0.0
select("pseudonyms.id, u.name AS user_name, e.user_id, e.course_id,
pseudonyms.sis_user_id, c.name AS course_name,
c.sis_source_id AS course_sis_id, s.name AS section_name,
e.course_section_id, s.sis_source_id AS section_sis_id,
t.name AS term_name, t.id AS term_id,
t.sis_source_id AS term_sis_id, e.computed_current_score,
e.computed_final_score,
CASE WHEN e.workflow_state = 'invited' THEN 'invited'
WHEN e.workflow_state = 'active' THEN 'active'
WHEN e.workflow_state = 'completed' THEN 'concluded'
@jakesorce
jakesorce / gist:6544491
Created September 12, 2013 22:06
conferences styleguide
@import 'environment';
/* @styleguide Item Groups Condensed
Item groups come either `item-group` or `item-group-condensed` styles.
The `item-group` style is for draggable items and `item-group-condensed`
is for items that are not draggable.
The outer `item-group-container` div is optional, and adds a background
color with a dashed line between groups.
Host gerrit
HostName gerrit.instructure.com
User dave
Port 29418
Host jump
Hostname jump1.us-east-1.canvas.insops.net
Host job07
Hostname job07-vpc
ProxyCommand ssh jump -W %h:%p
{:submitter=>"testteacher1",
:grade_type=>"midterm",
:environment=>"production",
:grades=>
[{:name=>"test student 1",
:student_sis_id=>"teststudent1",
:course_sis_id=>"HS422012014U",
:section_sis_id=>"test course - 4",
:grade=>"B-"}
]
{"data":[{"active":"Y","courseno":null,"description":"Final - Proctored","duration":120,"end_date":"2014-02-27T15:00:00Z","exam_id":"Final - Proctored-18","exam_no":27983,"instructor":null,"max_attempt":4,"notes":"open book and notes","password":"Iknowthepassword!","start_date":"2014-01-01T14:00:00Z","term_id":"6","term_name":"Physical Endurance 101","term_no":885},{"active":"Y","courseno":null,"description":"Final Exam ","duration":120,"end_date":"2014-02-28T14:00:00Z","exam_id":"Final Exam - Comprehensive-3","exam_no":27971,"instructor":null,"max_attempt":1,"notes":"closed everything","password":"proctoru","start_date":"2014-02-01T14:00:00Z","term_id":"1","term_name":"Intro to Online Monitoring","term_no":881}]}<html>
<head>
<title>Value cannot be null.<br>Parameter name: input</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Ve