Skip to content

Instantly share code, notes, and snippets.

@gchristian
gchristian / sff-api.py
Created February 28, 2024 04:52
pull decks using new api from digital client for sf fusion
import requests
lastPK = ""
all_decks = []
response = requests.request("GET",
"https://ul51g2rg42.execute-api.us-east-1.amazonaws.com/main/deck/app",
data="",
headers={},
params={
def make_request(self, id="", type="deck", username="TMind"):
endpoint = f"{self.base_url}/{type}/{id}"
self.params.update({"username" : username})
print(f"Requesting Data from Website: {','.join([username,type,id])}")
response = requests.get(endpoint, params=self.params)
data = json.loads(response.content)
#insert pagination code
@gchristian
gchristian / gist:c33ad0ea6eba44461b39b4b5aca49227
Last active November 10, 2022 03:08
pull fused decks into collection manager for solforge fusion
function pullFused(){
var ui = SpreadsheetApp.getUi();
var username = ui.prompt("Enter your Solforge Fusion Username");
console.log(username);
//the user name for which collection to grab
//fetch fused deck from api endpoint
@gchristian
gchristian / gist:3fbef690f7a4a71f528d98a3e9e616a0
Created July 28, 2022 03:21
build random fused deck for sff tts
function BuildRandomFused(username, player_color)
Player[player_color].broadcast("Fetching your deck, one moment please.")
FetchData('fuseddeck?pageSize=100&username=' .. username, function(error, data)
if error then
return Player[player_color].broadcast('Request for Deck failed:\n' .. data)
end
local fuseddecks = data.Items
local numberOfDecks = tablelength(fuseddecks)
@gchristian
gchristian / parsepdf.py
Last active May 24, 2021 18:24
parse pdf into smaller pdfs based on key value
#separate pdf based on a phrase that can be used to delineate break points and names files by first word after that break point
import PyPDF2
import pdfplumber
if __name__ == '__main__':
pdf_path = 'MBA Report Creator.pdf'
pdf_break_point = 'Student_Number '
base_pdf = PyPDF2.PdfFileReader(pdf_path)
new_pdf = PyPDF2.PdfFileWriter()
@gchristian
gchristian / clever.named_queries
Last active February 13, 2024 09:38
Example named query file for PowerSchool Clever sync
# This is an example only. I no longer use it and hope to update it eventually.
# If you are starting from scratch you should be using the users table not the teachers view
# for creating a PK for your staff. If you don't, teachers who teach at multiple schools will
# not work correctly. My fix was to just keep using the schoolstaff id's (that is what the
# teacher view uses) but make sure it is always the users homeschool's sschoolstaff id. It'd be
# cleaner to have just used the users table to begin with though. I have a much better understanding
# of mysql and ps tables then I was when I first wrote this.
<queries>
<query name="org.yourschool.clever.schools.all" coreTable="SCHOOLS" flattened="true">
@gchristian
gchristian / plugin.xml
Last active July 12, 2021 19:12
Example plugin.xml for PowerSchool Clever sync
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://plugin.powerschool.pearson.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://plugin.powerschool.pearson.com plugin.xsd"
name="Clever"
version="1.28"
description="Pull data for Clever sync">
<publisher name="Your Name">
<contact email="youremail@yourschool.org"/>
@gchristian
gchristian / com.google.Chrome.plist
Created January 12, 2016 04:46
chrome management settings for shared machines - blocks extension install and force installs Drive so google apps don't break.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AutoFillEnabled</key>
<false/>
<key>BookmarkBarEnabled</key>
<true/>
<key>ExtensionInstallBlacklist</key>
<array>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.google.Chrome</key>
<dict>
<key>AutoFillEnabled</key>
<dict>
<key>state</key>
<string>always</string>
@gchristian
gchristian / gist:4692090
Created February 1, 2013 15:44
script to re-enable java and stop xprotect from requiring a minimum version of java
#!/bin/bash
#step through users and check for java prefs file, if found enable java web componets
USERS=`ls /Users`
for f in $USERS
do
JPREFS=`ls /Users/$f/Library/Preferences/ByHost/com.apple.java.JavaPreferences.*.plist`
if [ -e "$FPREFS" ]
then