Skip to content

Instantly share code, notes, and snippets.

Connor Griffin ConnorGriffin

View GitHub Profile
@ConnorGriffin
ConnorGriffin / ynabZestimate.gs
Last active Sep 10, 2018
Automatically update your YNAB 'Home Value' tracking account with Zillow's Zestimate data
View ynabZestimate.gs
function updateYnabHomeZestimate() {
var accessToken = 'YNAB token goes here' // Your YNAB Personal Access Token
var zwsid = 'zwsid goes here' // Your Zillow ZWSID
var budgetName = 'budget name goes here' // The name of your budget
var accountName = 'home value account name goes here' // The name of your home value tracking account
var address = '1657 Notrealaddress Drive, Redding, CA 96001' // Home address
// YNAB API settings
var url = 'https://api.youneedabudget.com/v1'
var headers = {
@ConnorGriffin
ConnorGriffin / ynabReport-CategoryGroupSummary.gs
Last active Sep 25, 2018
YNAB Weekly Spending Report - Google Script (Standalone) - Using Totals from Category Groups
View ynabReport-CategoryGroupSummary.gs
// YNAB Weekly Spending Report sending script
function sendYnabReport() {
// Set our options
var accessToken = 'token goes here' // Your YNAB Personal Access Token
var budgetName = "Connor's Budget" // Budget name to use, in case you have multiple budgets
var categories = ['Sports & Wellness', 'Food & Drink', 'Housing'] // Your desired category groups to monitor, in Javascript array syntax
var recipient = 'test@example.com, test2@example.com' // Email recipients, comma separated
// API stuff
var url = 'https://api.youneedabudget.com/v1'
@ConnorGriffin
ConnorGriffin / ynabReport-CategoryGroups.gs
Last active Sep 25, 2018
YNAB Weekly Spending Report - Google Script (Standalone) - Using Category Groups instead of Categories
View ynabReport-CategoryGroups.gs
// YNAB Weekly Spending Report sending script
function sendYnabReport() {
// Set our options
var accessToken = 'token goes here' // Your YNAB Personal Access Token
var budgetName = "Connor's Budget" // Budget name to use, in case you have multiple budgets
var categories = ['Sports & Wellness', 'Food & Drink', 'Housing'] // Your desired category groups to monitor, in Javascript array syntax
var recipient = 'test@example.com, test2@example.com' // Email recipients, comma separated
// API stuff
var url = 'https://api.youneedabudget.com/v1'
@ConnorGriffin
ConnorGriffin / GDrive.Download.ps1
Created Sep 4, 2018
Download files from Google Drive, converting to specific MIME types if necessary
View GDrive.Download.ps1
# Set the Google Auth parameters. Fill in your RefreshToken, ClientID, and ClientSecret
$params = @{
Uri = 'https://accounts.google.com/o/oauth2/token'
Body = @(
"refresh_token=$RefreshToken", # Replace $RefreshToken with your refresh token
"client_id=$ClientID", # Replace $ClientID with your client ID
"client_secret=$ClientSecret", # Replace $ClientSecret with your client secret
"grant_type=refresh_token"
) -join '&'
Method = 'Post'
@ConnorGriffin
ConnorGriffin / quicktile.cfg
Last active Jul 23, 2018
My quicktile.cfg
View quicktile.cfg
[general]
cfg_schema = 1
ColumnCount = 3
UseWorkarea = True
ModMask = <Mod4>
MovementsWrap = True
[keys]
C = move-to-center
H = horizontal-maximize
@ConnorGriffin
ConnorGriffin / GoogleDrive.SheetExport.ps1
Created Jul 14, 2018
Google Sheets Export to PowerShell Object by GID (Sheet Tab ID)
View GoogleDrive.SheetExport.ps1
# Set our options
$RefreshToken = ''
$ClientID = ''
$ClientSecret = ''
$spreadsheetId = '' # Get this from the URL: https://docs.google.com/spreadsheets/d/{spreadsheetId}
$sheetId = '' # Get this from gid= in the URL
# Set the Google Auth parameters
$params = @{
Uri = 'https://accounts.google.com/o/oauth2/token'
@ConnorGriffin
ConnorGriffin / ynabReport.gs
Last active Oct 22, 2019
YNAB Weekly Spending Report - Google Script (Standalone)
View ynabReport.gs
// YNAB Weekly Spending Report sending script
function sendYnabReport() {
// Set our options
var accessToken = 'token goes here' // Your YNAB Personal Access Token
var budgetName = "Connor's Budget" // Budget name to use, in case you have multiple budgets
var categories = ['Fast Food', 'Groceries'] // Your desired category names to monitor, in Javascript array syntax
var recipient = 'test@example.com, test2@example.com' // Email recipients, comma separated
var url = 'https://api.youneedabudget.com/v1'
var headers = {
@ConnorGriffin
ConnorGriffin / Get-SrpUsage.ps1
Last active Dec 4, 2019
Get SRP (Salt River Project) power usage per hour using PowerShell
View Get-SrpUsage.ps1
# Set the SRP base url and get yesterday's date in a format that the report expects
$baseUrl = 'https://myaccount.srpnet.com'
$yesterday = (Get-Date).AddDays(-1).ToString('M/d/yyyy')
# Start a session, pull the form data
$r = Invoke-WebRequest $baseUrl -SessionVariable session
# Identify the username/password form
$loginForm = $r.Forms.Where{$_.Fields.Keys -contains 'UserName'}
@ConnorGriffin
ConnorGriffin / ConvertFrom-Hsl.ps1
Last active Jul 26, 2018
Powershell script to convert HSL to RGB
View ConvertFrom-Hsl.ps1
function ConvertFrom-Hsl {
param(
$Hue,
$Saturation,
$Lightness,
# Return in ConEmu.xml ABGR hex format
[Switch]$ABGR
)
function ToHex ($c) {
@ConnorGriffin
ConnorGriffin / ecobeeSmartHomeAway.js
Last active Apr 27, 2018
Home Assistant Node-RED Scripts
View ecobeeSmartHomeAway.js
var homeStatus = msg.payload.data.state
var homeStatusMinutes = Math.floor((msg.payload.timeSinceChangedMs/1000)/60)
var notHome = (homeStatus == "not_home" && homeStatusMinutes >= 10)
var ecobeeStatus = flow.get("ecobeeStatus")
var holdMode = ecobeeStatus.data.attributes.hold_mode
var climateMode = ecobeeStatus.data.attributes.climate_mode
var operationMode = ecobeeStatus.data.attributes.operation_mode
// Set the holdMatch criteria based on whether we're home or not, this is so we don't cancel temp or vacation holds
You can’t perform that action at this time.