Skip to content

Instantly share code, notes, and snippets.

View avrahamappel's full-sized avatar

Avraham Appel avrahamappel

View GitHub Profile
@avrahamappel
avrahamappel / convert-screencast-to-gif.sh
Created October 28, 2025 22:01
Convert screencast to GIF
ffmpeg -i INPUT.MOV -vf 'setpts=0.5*PTS,fps=30' OUTPUT.GIF
@avrahamappel
avrahamappel / bus-script.py
Last active November 26, 2025 22:45
Get notified when your TSTG bus is almost at your stop
#!/usr/bin/env python3
import json
import math
import os
import requests
from bs4 import BeautifulSoup
# Function to calculate the distance between two latitude/longitude points
ata3.00: exception Emask 0x0 SAct 0x40000 SErr 0x40000 action 0x0
ata3.00: irq_stat 0x40000000
ata3: SError: { CommWake }
ata3.00: failed command: READ FPDMA QUEUED
ata3.00: cmd 60/00:90:30:36:16/01:00:0e:00:00/40 tag 18 ncq dma 131072 in
res 51/40:00:30:36:16/00:01:0e:00:00/40 Emask 0x409 (media error) <F>
ata3.00: status: { DRDY ERR }
ata3.00: error: { UNC }
I/O error, dev sda, sector 236336688 op 0x0:(READ) flags 0x80700 phys_seg 32 prio class 2
ata3.00: exception Emask 0x0 SAct 0x40000 SErr 0x40000 action 0x0
@avrahamappel
avrahamappel / download-masechta.sh
Created January 5, 2026 04:56
Download a full masechta from realcleardaf.com
#!/usr/bin/env nix-shell
#!nix-shell -p curl fd poppler-utils
MASECHTA=${MASECHTA:-yevamos}
DAFIM=${DAFIM:-122}
for daf in {2..$DAFIM}; do
for amud in {a..b}; do
echo "Downloading $MASECHTA daf $daf$amud"
curl --output-dir $MASECHTA -O "https://www.realcleardaf.com/wp-content/uploads/daf/$MASECHTA-$daf$amud.pdf"
mapkey('P', '#1Paste from clipboard', function() {
// Grab the latest clipboard entry
const clipboardText = Clipboard.get();
// Get all input elements on the page
const inputs = $$('input, textarea');
// Check how many inputs there are
if (inputs.length === 0) {
alert("No input fields found.");