Skip to content

Instantly share code, notes, and snippets.

# report 1: student orentation status
m1 = Course.find(302).context_modules[0].context_module_progressions.where(workflow_state: 'completed').pluck :user_id
m2 = Course.find(302).context_modules[1].context_module_progressions.where(workflow_state: 'completed').pluck :user_id
m3 = Course.find(302).context_modules[2].context_module_progressions.where(workflow_state: 'completed').pluck :user_id
students = Course.find(302).enrollments.where(type: 'StudentEnrollment').map{|e| [e.user.id, e.user.name, e.user.email]}
progress = students.map{|s| s + [m1.include?(s[0]).to_s, m2.include?(s[0]).to_s, m3.include?(s[0]).to_s] }
# report 2: sbc orientation status
@radiokills
radiokills / gist:7767442
Created December 3, 2013 11:04
rails locales ds
en:
errors:
messages:
wrong_size: "is the wrong size (should be %{file_size})"
size_too_small: "is too small (should be at least %{file_size})"
size_too_big: "is too big (should be at most %{file_size})"
number:
format:
precision: 2
@radiokills
radiokills / Default (OSX).sublime-keymap
Last active December 23, 2015 10:19
Sublime put spaces around curly brackets
[
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": " { $0 }"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "source.ruby" }
]
}
]
@radiokills
radiokills / new_gist_file
Created September 18, 2013 00:55
css wodth incl borders and padd
2
3
*, *:after, *:before {
box-sizing: border-box;
}
$.fn.modal_form = (element)->
modal_form = new ModalForm
$(document).delegate('form[data-modal-result=true]', 'ajax:success', (data, xhr, status) ->
modal_form.form_result(data,xhr,status)
)
$(document).delegate('form[data-modal-result=true]', 'ajax:error', (data, xhr, status) ->
modal_form.form_result(data, xhr, status)
)