Skip to content

Instantly share code, notes, and snippets.

View rickcnagy's full-sized avatar

Rick Nagy rickcnagy

View GitHub Profile
@rickcnagy
rickcnagy / alpha.py
Created January 31, 2014 04:43
Filters a string for a certain subset of characters, such as only letters or alphanumeric characters.
# from http://stackoverflow.com/a/12851835/1628796
# returns only the lowercase version of the letters - useful for comparing strings
def alpha(string):
return ''.join([i for i in string if i.isalpha()]).lower()
@rickcnagy
rickcnagy / qs-EnrollmentParser.js
Last active August 29, 2015 13:56
Parse subject enrollment information (via Google Apps Script) where each enrollment has a single line (so multiple per student), instead of 1 row per student. To produce the enrollment information, run the report: Subject Enrollment for Subject Set/Band Importer.
// For Google Apps Script
// qs-EnrollmentParser.js
// Rick Nagy, 2/14/14
/*
Creates an output file in the directory of the input file.
Input file should be direct output from Subject Enrollment for Subject Set/Band Importer.
Folder name of input file should be the name of the school.
*/
@rickcnagy
rickcnagy / fake_gradebooks.py
Last active October 27, 2018 14:21
Fake Gradebook Data: Fills every assignment in every section with fake gradebook data - useful for creating fake gradebook data for demo schools or support trial schools.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
"""
Fills every assignment in every section with fake gradebook data - useful
for creating fake gradebook data for demo schools or support trial schools.
"""
import requests
import qs
from tqdm import *
@rickcnagy
rickcnagy / quad.8xp
Last active August 29, 2015 13:56
Quadratic Formula for TI-84 Plus via http://www.tc3.edu/instruct/sbrown/ti83/quadrat.htm
Disp "AX²+BX+C=0"
Prompt A,B,C
B²-4AC→D
Disp (-B+√(D))/(2A)
Disp (-B−√(D))/(2A)
@rickcnagy
rickcnagy / qsAdmissionsGadget_ricknagy
Last active August 29, 2015 13:56
QuickSchools Admissions Form as a Google Gadget (ricknagy)
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="hello world example" />
<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 / qsInquiryGadget_isom.xml
Last active August 29, 2015 13:56
QuickSchools Inquiry 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 / README.md
Last active August 29, 2015 13:56
Batch Replace Report Card Template Colors via Raw Data Dump

Directions

To install (OS X):

  1. Open up Control and download the Raw Data Dump for the template you're working with.
  2. Click the Download Gist button on the left of this page.
  3. Drag the downloaded file to your Desktop and double click the file to unzip.
  4. Open up the resulting folder and drag replace_template_colors.py to your Desktop
  5. Open up Terminal.app
  6. Enter the following command in the terminal window: sudo ~/Desktop/replace_template_colors.py, then enter your password.
@rickcnagy
rickcnagy / qs.py
Last active August 29, 2015 13:56
Python Wrapper for the QuickSchools REST API. Work in progress.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
'''
various tools for working with the QuickSchools API
'''
import sys
import os
import json
import random
@rickcnagy
rickcnagy / download_gradebook_data.py
Last active August 29, 2015 13:56
Download gradebook data from assignments spanning a certain date range and/or from a certain teacher. Data can then be uploaded via upload_gradebook_data.py.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
'''
Directions:
- make Q1 the active semester
- run this script to download all assignments from Q1 in the time range
- activate Q2
- run upload_gradebook_data.py to upload to Q2
- reactivate Q1
- run delete_assignments.py to delete the assignments posted to Q2
@rickcnagy
rickcnagy / upload_gradebook_data.py
Last active August 29, 2015 13:56
Upload gradebook data downloaded via download_gradebook_data.py
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
'''
Upload gradebook data downloaded via download_gradebook_data.py
'''
from tqdm import *
import qs
import api_logging
import data_migration