Skip to content

Instantly share code, notes, and snippets.

View simonista's full-sized avatar

Simon Williams simonista

  • Lumio
  • Austin, TX
View GitHub Profile
set nocompatible
filetype off " needed to load vundle
" Manage plugins with vundle
" run :PluginInstall (or vim +PluginInstall +qall on cli)
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
Plugin 'gmarik/vundle'
" Security

How To Create A New Question Type (wip)

  • add a new file in app/models/quiz_question/ that extends QuizQuestion::Base (or another question type)
  • extend the appropriate scoring functions:
    • stats
    • total_answer_parts
    • correct_answer_parts
    • incorrect_answer_parts
  • requires_manual_scoring?
# ...
gem 'canvas_oauth_engine', :require => 'canvas_oauth'
# ...
@simonista
simonista / Gemfile
Last active December 25, 2015 01:09
# ...
gem 'lti_provider_engine', :require => 'lti_provider'
# ...
@simonista
simonista / development-local.rb
Last active December 21, 2015 19:59
put this in config/
config.cache_classes = true
config.action_controller.perform_caching = true
config.action_view.cache_template_loading = true
# ENV['USE_OPTIMIZED_JS'] = "true"
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
</head>
<body>
<a href='#' id='controller' aria-expanded=true aria-controls='blah'>Click Me</a>
<div id='blah'>
<p>hi</p>
</div>
group :development do
gem "pry"
gem "powder"
gem "letter_opener"
gem "better_errors", ">= 0.7.2"
gem "binding_of_caller", ">= 0.7.1"
gem 'meta_request'
gem "html2haml", ">= 1.0.1"
gem 'guard'
gem 'rb-fsevent', require: false
@simonista
simonista / _Footer.txt
Last active December 14, 2015 23:09
Gollum with basic auth + file uploads
# - fail.png => http://cl.ly/image/183e0Z3L181f
# - pass.png => http://cl.ly/image/233w153f3o2C
# - add `.build-icon { border: none; }` to your theme css
images =
fail: 'http://f.cl.ly/items/3W0B3C1l3u3D0w231y2y/fail.png'
pass: 'http://f.cl.ly/items/1g153P1F302c1h1F0T0P/pass.png'
bind 'line', (line) ->
message = $(line).find '.message'
guid = ...
LearningOutcomeGroup.find_by_vendor_guid(guid).destroy
LearningOutcomeGroup.find_all_by_workflow_state("deleted").each{|log| log.destroy!}
ContentTag.all.each{|ct| ct.content.try(:destroy!) if ct.context.blank?}
cts_to_delete = []
ContentTag.all.each{|ct| cts_to_delete << ct if ct.content.blank? || ct.context.blank?}
cts_to_delete.each(&:destroy!)