This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get_wk_token.py // jeffehobbs@gmail.com // Nov. 2022 | |
# from documentation here, which you should read first: | |
# https://developer.apple.com/documentation/weatherkitrestapi/request_authentication_for_weatherkit_rest_api | |
# | |
# 1. Have a valid ADC acount. https://developer.apple.com | |
# 2. Download this script, and open it in a text editor. You'll have to change three variables. | |
# 3. Make up a reverse-domain name service ID (i.e., com.domain.app). Place this in SERVICE_ID. | |
# 4. Create an ADC service identifier. https://developer.apple.com/account/resources/identifiers/add/bundleId | |
# 5. Create an ADC service key. https://developer.apple.com/account/resources/authkeys/add | |
# 6. Download that service key, rename to 'wkservicekey.p8', and move it into same directory as this script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# craigsdalle - builds DALL-E art from Missed Connections posts & tweets | |
# jeffehobbs@gmail.com // November 2022 | |
import asyncio | |
from pyppeteer import launch | |
import openai, tweepy, requests, configparser, os, shutil, hashlib | |
from mastodon import Mastodon | |
# set up API keys from external config apikeys.txt file | |
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in *.mkv; do | |
ffmpeg -i "$i" -codec copy "${i%.*}.mp4" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir wav; for i in *.aif; do ffmpeg -i "$i" "./wav/${i%.*}.wav"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |