Skip to content

Instantly share code, notes, and snippets.

View rickcnagy's full-sized avatar

Rick Nagy rickcnagy

View GitHub Profile
@rickcnagy
rickcnagy / CopyZeusValues.js
Last active August 29, 2015 13:57 — forked from rickcnagy/SaveRecords.js
Copies values from one Zeus Report Card identifier to another. Relies on all report cards using the "For Identifier Value Copying" template.
//
// CopyZeusValues.js
// Rick Nagy
// 2014-03-31
//
// run via js console
function init() {
@rickcnagy
rickcnagy / cd_cwd.py
Created March 30, 2014 14:36
CD into the current script's directory.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
@rickcnagy
rickcnagy / pld.py
Last active November 29, 2022 20:54
Unofficial Python wrapper/library for the Pipeline Deals API.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
import math
import requests
import api_logging
import time
base_uri = 'https://api.pipelinedeals.com/api/v3'
api_key = 'API KEY HERE'
@rickcnagy
rickcnagy / SaveRecords.js
Last active August 29, 2015 13:57
Opens and saves a list of records in an Aura DataTable, such as students in the Students module, report cards in the Report Cards module, transcripts, etc. Fork as necessary for specific locales.
//
// OpenAndSaveRecords.js
// Rick Nagy
// 2014-03-26
//
// run via js console
function init() {
stopAsap = false;
//
// 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 / pld_add_default_contact.py
Created March 25, 2014 04:13
Adds a "Default Contact" person to each record in the PLD company database.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
import requests
import math
import json
api_key = 'API_KEY'
base_url = "https://api.pipelinedeals.com/api/v3"
azreen_id = '25077'
@rickcnagy
rickcnagy / titleCaseColumn.js
Last active August 29, 2015 13:57
Proper Case all values in a colum
// Google Apps Script
// relies on titleCaps(): http://ejohn.org/blog/title-capitalization-in-javascript/
function titleCaseColumn() {
var columnNum = 5;
ss = SpreadsheetApp.getActiveSheet();
for(var i = 2; i < ss.getLastRow(); i++) {
var proper = titleCaps(ss.getRange(i, columnNum).getValue().toLowerCase());
@rickcnagy
rickcnagy / NCES_Grade_Levels.js
Last active August 29, 2015 13:57
Calculate a school's K12 Levels (PreK, Elem, etc) based on the lowest and highest age.
// for Google Sheets
function calculateLevels() {
var youngColumn = 3;
var outputColumn = 5;
ss = SpreadsheetApp.getActiveSheet();
var range = ss.getRange(2, youngColumn, ss.getLastRow(), 3);
var vals = range.getValues();
@rickcnagy
rickcnagy / fileFromSelection.sh
Last active August 29, 2015 13:57
Create incremental file from input text (for Alfred Workflow)
cd ~/Desktop
# incremental filename
# http://stackoverflow.com/a/806923/1628796
isnumeric() {
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo 0
else
@rickcnagy
rickcnagy / clear_gradebook.py
Created March 18, 2014 02:26
Clear a section's gradebook by deleting ALL assignments.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
import qs
from tqdm import *
def main():
section_id = "528351"
assignments = qs.get_assignments(section_id)
for i in trange(0, len(assignments)):
qs.delete_assignment(section_id, assignments[i]['id'])