Skip to content

Instantly share code, notes, and snippets.

View rickcnagy's full-sized avatar

Rick Nagy rickcnagy

View GitHub Profile
@rickcnagy
rickcnagy / delete_assignments.py
Last active August 29, 2015 13:56
Delete assignments after they've been migrated via upload_gradebook_data.py
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
'''
delete assignments after they've been migrated via upload_gradebook_data.py
'''
import qs
import pickle
import requests
from tqdm import *
@rickcnagy
rickcnagy / OpenAndSaveStudentRecords.js
Created February 24, 2014 21:26
Open and save all visible student records on the Student module.
//
// OpenAndSaveStudentRecords.js
// Console JavaScript
//
// Created by Rick Nagy on 2014-01-27.
//
// This will go down the student list in the Students module and click and save each student
//
// set TRIGGER_KEYUP to true to also trigger the keyUp() method in the name field
// this is useful for triggering the name parser, which is useful
@rickcnagy
rickcnagy / folder_pdf_page_count.py
Created March 3, 2014 04:35
Count pages of each PDF in a directory and filter for PDF's over a certain page limit. Useful if trying to fit report cards to a certain page requirement; download all from Report Cards module and then run this script on the downloaded folder to see the report cards that don't math the page requirement.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
import re
import os
import json
folder_path = 'FOLDER PATH'
rxcountpages = re.compile(r"/Type\s*/Page([^s]|$)", re.MULTILINE | re.DOTALL)
@rickcnagy
rickcnagy / qsAdmissionsGadget_isom.xml
Created March 3, 2014 19:09
QuickSchools Application Form as a Google Gadget (isom)
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="QuickSchools Admissions Form" />
<Content type="html">
<![CDATA[
<div id="enquiry-form"></div>
<div class="qsstandalone-footnote" id="enquiry-footer">Form powered by <a href="http://www.quickschools.com" target="_blank">QuickSchools.com - School Management System</a></div>
<script>
@rickcnagy
rickcnagy / DeleteSubjects.js
Created March 4, 2014 19:41
Delete all subjects visible in the Global Subject(Course) Setup tab. All students must be unenrolled from all visible subjects.
//
// DeleteSubjects.js
// Rick Nagy
// 2014-03-04
//
// Run via js console
javascript: buttons = document.getElementsByClassName('buttonWidget allButtons');
i = 0;
@rickcnagy
rickcnagy / SaveAllGradebooks.js
Last active August 29, 2015 13:57
Open and save every gradebook in the Gradebook module. Useful for recalculating formulas when the gradebook data have somehow changed.
//
// SaveAllGradebooks.js
// Rick Nagy
// 2014-03-06
//
// run via js console
currentTeacher = 0;
currentSection = 0;
@rickcnagy
rickcnagy / sql_formal.rb
Created March 11, 2014 20:25
Format SQL text in TextMate via sqlformat.org
#!/usr/bin/env ruby
require 'uri'
require 'net/http'
require 'json'
uri = URI("http://sqlformat.org/api/v1/format")
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = false
@rickcnagy
rickcnagy / data_migration.py
Last active August 29, 2015 13:57
Data migration via the QuickSchools API - utility module.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
"""Data migration via the QuickSchools API - utility module."""
import qs
import api_logging
import pickle
import os
import random
import sys
@rickcnagy
rickcnagy / api_logging.py
Last active August 29, 2015 13:57
Wrapper on top of the Logger class for logging QuickSchools API requests
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
"""Wrapper on top of the Logger for logging QuickSchools API requests"""
import logging
import json
import sys
import random
import os
import traceback
import syslog
@rickcnagy
rickcnagy / afterLoad.js
Last active August 29, 2015 13:57
Run function on QuickSchools page after loading finishes. Pass callback and callback param as parameter i.e. afterLoad(alert, 'hi').
function afterLoad(callback, param) {
var loading = setInterval(function() {
if ($( "*[class^='load']:not('.ribbonSelectorWidget *'):visible" ).length === 0) {
clearInterval(loading);
callback(param);
}
}, 10, param);
}