Skip to content

Instantly share code, notes, and snippets.

View phil-lopreiato's full-sized avatar

Phil Lopreiato phil-lopreiato

View GitHub Profile
@phil-lopreiato
phil-lopreiato / delta.sh
Created September 29, 2014 16:20
A script for checking when websites have changed and notifying via email
#!/bin/bash
CHANGED=()
abs=/abs/path/to/script/
# if we're calling from cronjob, use absolute path
if [ "$abs" == $(pwd) ]; then
pref=
else
pref=$abs
fi
@phil-lopreiato
phil-lopreiato / push_sitevars
Created August 30, 2014 01:55
Push Sitevars
These can all be added from APIs and Auth -> Credentials in the App Engine control panel
1. gcm.serverKey - Make sure you've enabled "Google Cloud Messaging for Android" API in the APIs section. Create a new server key for Public API Access.
2. appengine.webClientId - Create a new oauth Client ID for a web application
3. android.clientId - Create a new oauth Client ID for an Android Application. Include the package name and key fingerprint
@phil-lopreiato
phil-lopreiato / deploy.sh
Last active August 29, 2015 14:05
Script to deploy TBA to App Engine, then generate and include the endpoints library
#! /bin/bash
perl -pi -e 's/tbatv-dev-hrd/tba-dev-phil/g' ~/Documents/Code/the-blue-alliance/app.yaml
./appcfg.py --oauth2 rollback ~/Documents/Code/the-blue-alliance/
# Replace cron.yaml with a different file to disable cron jobs
mv ~/Documents/Code/the-blue-alliance/cron.yaml ~/Documents/Code/the-blue-alliance/cron.yaml.bak
cp ~/Documents/Code/cron.yaml.simple ~/Documents/Code/the-blue-alliance/cron.yaml
./appcfg.py --oauth2 update ~/Documents/Code/the-blue-alliance/
@phil-lopreiato
phil-lopreiato / parse_csv.py
Last active August 29, 2015 14:02
FRC Twitter Data 2012 - 2014
import csv
import json
with open("2012_data.csv") as data:
reader = csv.reader(data, delimiter=',', quoting=csv.QUOTE_NONE)
reader.next()
matches = []
for line in reader:
match = {}
match["eventKey"] = "2012"+line[0]
@phil-lopreiato
phil-lopreiato / FIM_YT_uploads.csv
Last active August 29, 2015 13:57
All uploads to the FIM Youtube Account
title youtube_key
Q-079 - Kettering District - 2014 K1ljs3uLSXI
Finals 1-2 - St. Joseph District - 2014 C35q1NmIQZI
Finals 1-1 - St. Joseph District - 2014 Hrg2Qxry4oo
Semifinals 1-3 - St. Joseph District - 2014 fW0ySG6S8wE
Semifinals 1-2 - St. Joseph District - 2014 RynP0vdFbqk
Semifinals 2-1 - St. Joseph District - 2014 XM8i_tDYAUk
Semifinals 1-1 - St. Joseph District - 2014 xzoA-8ZZDO8
Quarterfinals 2-3 - St. Joseph District - 2014 TgouiCY1Y0g
Quarterfinals 1-3 - St. Joseph District - 2014 qQBuwig2-dw