Skip to content

Instantly share code, notes, and snippets.

View freshyjmp's full-sized avatar
💫
Jon is typing...

Jon Patterson freshyjmp

💫
Jon is typing...
View GitHub Profile
@freshyjmp
freshyjmp / countdown.2h.py
Created April 3, 2021 04:52
xbar countdown timer for quitting your job
#!/usr/bin/env python3
# Drop this in your xbar plugins folder.
# Set to be executable.
# Keep your deadline in mind.
from datetime import datetime, timedelta
DEADLINE = datetime(2022, 12, 31)
def main():
days_left = DEADLINE - datetime.now()
@freshyjmp
freshyjmp / mtg_tracker.gs
Last active July 8, 2021 07:04
rudimentary example of using custom functions to make API requests w/caching service in Google App Script
var public_key = 'SET THIS YOURSELF';
var private_key = 'ALSO SET THIS YOURSELF';
var cache = CacheService.getDocumentCache();
const CACHE_KEY = 'cardboard_wealth_token_response';
const GROUP_KEY = 'mtg_groups';
const PRICE_KEY = 'mtg_prices';
const PRODUCT_KEY = 'mtd_products';
@freshyjmp
freshyjmp / bucket_upload.py
Created February 5, 2024 22:51
Upload Files to S3 Directory
import os
import boto3
import click
from botocore.exceptions import NoCredentialsError
@click.command()
@click.option('--bucket-name', required=True, help='Name of the S3 bucket.')
@click.option('--local-directory', required=True, type=click.Path(exists=True), help='Path to the local directory to sync.')
@click.option('--s3-directory', required=True, help='S3 directory (prefix) to sync with.')
def sync_s3(bucket_name, local_directory, s3_directory):