Skip to content

Instantly share code, notes, and snippets.

@pastorhudson
pastorhudson / atsbuttonbox.ino
Created December 1, 2023 02:18
American Truck Simulator Button Box
//BUTTON BOX
//USE w ProMicro
//Tested in WIN10 + Assetto Corsa
//AMSTUDIO
//20.8.17
#include <Keypad.h>
#include <Joystick.h>
#define ENABLE_PULLUPS
@pastorhudson
pastorhudson / staff_sort.liquid
Last active April 21, 2022 01:55
Display staff using Staff Title custom tab. No household needed
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
{% assign pastor_title = "Sr Pastor" %}
{% assign assoc_pastor_title = "Associate Pastor" %}
{% assign worship_leader_title = "Worship Leader" %}
{% assign kids_director_title = "Kids Director" %}
{% assign print_staff = true %}
{% for household in households %}
@pastorhudson
pastorhudson / dice_roll.py
Last active February 11, 2022 18:04
Roll A dice and display in Turtle
import shutil
from tkinter import Image
import requests
import turtle
from PIL import Image
def get_dice_url():
dice = requests.get('http://roll.diceapi.com/html/d6')
return dice.text.split('"')[1]
@pastorhudson
pastorhudson / webhook.py
Last active October 20, 2021 02:52
Flask Keybase Bot
import json
from flask import Flask
from pathlib import Path
import subprocess
app = Flask(__name__)
"""Don't Forget you need keybase running as a service using the same keybasehomedir
keybase --home ./keybasehomedir service --oneshot-username botname < paper-key"""
@pastorhudson
pastorhudson / patch_field_datum.py
Last active June 16, 2021 11:32
Patch FieldDatum in Planning Center Online using pypco
import pypco
import os
"""Best practice is to store credentials in environment variables."""
pco = pypco.PCO(application_id=os.environ.get('PCO_APPLICATION_ID'),
secret=os.environ.get('PCO_API_SECRET'))
def get_field_definition(field_name):
field_definitions = pco.iterate('/people/v2/field_definitions')
@pastorhudson
pastorhudson / get_pa_covid_vaccine_data.py
Created December 15, 2020 20:20
Grabs the excel file(s) of covid vaccination distribution info for PA from health.pa.gov
from bs4 import BeautifulSoup
import requests
import urllib.parse
from urllib.parse import unquote
from pathlib import Path
SCRAPEURL = 'https://www.health.pa.gov/topics/disease/coronavirus/Pages/Vaccine.aspx'
BASEURL = "https://www.health.pa.gov"
@pastorhudson
pastorhudson / update.py
Created October 5, 2020 02:55
pykeybasebot Advertize available commands
# This goes in your async def handler(bot, event):
async def advertize_commands(
bot, channel: chat1.ChatChannel, message_id: int
) -> chat1.SendRes:
await bot.ensure_initialized()
res = await bot.chat.execute(
{
"method": "advertisecommands",
"params": {
@pastorhudson
pastorhudson / resource_events.py
Created January 21, 2020 20:51
Simple Resources Event Lookup
import pypco
from datetime import datetime
import time
now = datetime.now() # current date and time
# PCO time format 2015-10-08T17:56:41Z
notification_start_time = now.strftime("%Y-%m-%dT%H:%M:%SZ")
print(f"Watching for notifications past {notification_start_time}")
pco = pypco.PCO('APP_ID',
'APP_SECRET',)
while True:
### Keybase proof
I hereby claim:
* I am pastorhudson on github.
* I am pastorhudson (https://keybase.io/pastorhudson) on keybase.
* I have a public key ASCIy4RRsgv8pfNMXfngLmkdcira01Vh_srM0Zq75pTukQo
To claim this, I am signing this object:
Chrome developer tools are your friend.
Right click the login page and click inspect. Click the network tab and then do the login normally through the page.
In the list in the network tab look for the post request that performed the login.
It’s usually a post to /login or /login/auth or something like that.
Scroll to the bottom of that request and you’ll be able to see all the information that is sent to complete the login.