Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Hobbs jeffehobbs

View GitHub Profile
@jeffehobbs
jeffehobbs / quit_all.scpt
Last active Jul 18, 2022
AppleScript to quit all open Applications on MacOS
View quit_all.scpt
tell application "System Events" to set the visible of every process to true
set allow_list to {"Finder"}
try
tell application "Finder"
set process_list to the name of every process whose visible is true
end tell
repeat with i from 1 to (number of items in process_list)
set this_process to item i of the process_list
@jeffehobbs
jeffehobbs / waveform.py
Last active Jun 30, 2022
waveform.py: make cool lookin' twitter-sharable video from .wav file
View waveform.py
# waveform.py | jeffehobbs@gmail.com
# Process an .wav audio file, make an .mp4 waveform video suitable for TWTR
# usage: waveform.py audiofile.wav
import subprocess, random, argparse, os
# get input
parser = argparse.ArgumentParser(description='Process an .wav audio file, make an .mp4 waveform video.')
parser.add_argument('file', type=str, help='filename')
args = parser.parse_args()
@jeffehobbs
jeffehobbs / recaptcha_v3.py
Created Jun 24, 2022
recaptcha_v3_endpoint.py
View recaptcha_v3.py
# minimally viable recaptcha v3 lambda
# jeffehobbs@gmail.com
from flask import Flask, Response, request, jsonify
from flask_cors import CORS
import requests
SECRET_KEY = 'your_recaptcha_v3_server_side_token'
app = Flask(__name__)
@jeffehobbs
jeffehobbs / convert_mkv.sh
Created Jun 12, 2022
convert mkvs to mp4s via container swap
View convert_mkv.sh
for i in *.mkv; do
ffmpeg -i "$i" -codec copy "${i%.*}.mp4"
done
@jeffehobbs
jeffehobbs / zsh
Created Jun 4, 2022
FFMPEG convert all .aif files in directory to .wav
View zsh
mkdir wav; for i in *.aif; do ffmpeg -i "$i" "./wav/${i%.*}.wav"; done
@jeffehobbs
jeffehobbs / app.py
Last active Jun 9, 2022
hotgrepper
View app.py
# hotgrepper.py | jeffehobbs@gmail.com
import requests, json, boto3, random, os, videogrep, configparser
from collections import Counter
from yt_dlp import YoutubeDL
from tweepy import OAuthHandler
from tweepy import API
STOPWORDS = ["i", "we're", "you're", "that's", "it's", "us", "i'm", "me", "my", "myself", "we", "our", "ours", "ourselves", "you", "your", "yours", "yourself", "yourselves", "he", "him", "his", "himself", "she", "her", "hers", "herself", "it", "its", "itself", "they", "them", "their", "theirs", "themselves", "what", "which", "who", "whom", "this", "that", "these", "those", "am", "is", "are", "was", "were", "be", "been", "being", "have", "has", "had", "having", "do", "does", "did", "doing", "a", "an", "the", "and", "but", "if", "or", "because", "as", "until", "while", "of", "at", "by", "for", "with", "about", "against", "between", "into", "through", "during", "before", "after", "above", "below", "to", "from", "up", "down", "in", "out", "on", "off", "over", "under", "again", "further", "then"
@jeffehobbs
jeffehobbs / beepy_boopy.py
Created Mar 22, 2022
loop of fast and slow random audio
View beepy_boopy.py
import time
import random
import array
import math
import audiocore
import board
import digitalio
import audiobusio
audio = audiobusio.I2SOut(board.GP10, board.GP11, board.GP9)
@jeffehobbs
jeffehobbs / tones.py
Last active Apr 4, 2022
simple python script that generates a set of smoothly looping tones
View tones.py
import math, wave, array
filenames = []
for filename in range(32):
x = filename % 8
y = filename / 8
filenames.append(str(math.trunc(y)) + str(x))
# use range to generate tones (lowest Hz, highest Hz, steps in Hz between)
for frequency in range(20, 460, 20):
@jeffehobbs
jeffehobbs / gaz.js
Created Oct 23, 2021
get past Newspapers of New England paywall
View gaz.js
// get past Newspapers of New England paywall
var background = document.getElementById("ta_background");
background.remove();
var modal = document.getElementById("ta_paywall");
modal.remove();
@jeffehobbs
jeffehobbs / ytpod.py
Last active Oct 13, 2021
script to download YouTube videos, shift them to s3, and make a simple podcast feed
View ytpod.py
# ytpod.py // jeffehobbs@gmail.com
# version 1.1.0
#
# goal: create XML feed + links to m4a versions of YT videos in specific playlist
#
# steps/done:
# 1. parse YT playlist(s), get id + metadata of each video
# 2. download m4a file for each video, save to s3
# 3. create XML file representing overview of feed, save to s3