Skip to content

Instantly share code, notes, and snippets.

View jaygooby's full-sized avatar
✏️
working on https://writiny.com in my sparse spare time

Jay Caines-Gooby jaygooby

✏️
working on https://writiny.com in my sparse spare time
View GitHub Profile
@Dowwie
Dowwie / socratic_fp_learning.md
Created June 7, 2025 09:23
Following is a prompt for effective learning with an LLM. It uses the Socratic method to help the student build up their understanding from first principles. Replace the topic in the prompt and then in your follow-up prompt , specify the subject.

You are a teacher of algorithms and data-structures who specializes in the use of the socratic method of teaching concepts. You build up a foundation of understanding with your student as they advance using first principles thinking. Explain the subject that the student provides to you using this approach. By default, do not explain using source code nor artifacts until the student asks for you to do so. Furthermore, do not use analysis tools. Instead, explain concepts in natural language. You are to assume the role of teacher where the teacher asks a leading question to the student. The student thinks and responds. Engage misunderstanding until the student has sufficiently demonstrated that they've corrected their thinking. Continue until the core material of a subject is completely covered. I would benefit most from an explanation style in which you frequently pause to confirm, via asking me test questions, that I've understood your explanations so far. Particularly helpful are test questions related to sim

@stuartlangridge
stuartlangridge / makehls
Created April 16, 2025 06:43
makehls, a Python script that makes an HLS streamable version of a video by constructing an ffmpeg command line
#!/usr/bin/env python3
"""
To make a video display in a web page so it adapts to the user,
you want to do two things:
1. serve the video at a size that matches the user's screen and
device. This is the job of responsive video, and is described by
https://scottjehl.com/posts/using-responsive-video/ very well
// Update 2025-05-22 — ported to rand v0.9, using a struct with Display impl rather than returning a string
struct MarineLine;
impl std::fmt::Display for MarineLine {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use rand::{Rng, seq::IndexedRandom};
let marine_life = ["🐳", "🐠", "🦈", "🐙", "🐡", "🐬", "🐟", "🦀", "🐋"];
let water = [
@thomaswilburn
thomaswilburn / pigeon.js
Last active January 18, 2026 09:43
Convert CSS to nested CSS
import { parse } from "https://deno.land/x/css@0.3.0/mod.ts";
var file = Deno.args[0];
var input = await Deno.readTextFile(file);
var parsed = parse(input, { value: true });
var root = {
rules: [],
@ryancdotorg
ryancdotorg / wzip.py
Last active January 25, 2025 22:46
Partial/streaming zip downloader
#!/usr/bin/env python3
# SPDX-License-Identifier: 0BSD or CC0-1.0 or MIT-0 or Unlicense
# Copyright (c) 2023, Ryan Castellucci, No Rights Reserved
import io, sys
import datetime
import argparse
import requests
import operator
import struct
@xdesro
xdesro / killport.sh
Last active January 7, 2026 09:31
Kill processes at a given port.
function killport {
echo '🚨 Killing all processes at port' $1
lsof -ti tcp:$1 | xargs kill
}
@ieatfood
ieatfood / Connect Airpods.applescript
Last active January 10, 2026 02:41 — forked from jaredmoody/Connect Airpods.applescript
An Applescript to connect bluetooth devices, such as Airpods. Nice when paired with an alfred trigger.
# Taken from https://www.reddit.com/r/MacOS/comments/i4czgu/big_sur_airpods_script/gck3gz3/
# by https://github.com/smithumble
use framework "IOBluetooth"
use scripting additions
set AirPodsName to "AirPods"
on getFirstMatchingDevice(deviceName)
repeat with device in (current application's IOBluetoothDevice's pairedDevices() as list)
#!/bin/bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# inspired by
# https://gist.github.com/codeinthehole/26b37efa67041e1307db
# https://github.com/why-jay/osx-init/blob/master/install.sh
# https://github.com/timsutton/osx-vm-templates/blob/master/scripts/xcode-cli-tools.sh
@nomeddie
nomeddie / smtpd.conf
Created November 27, 2020 23:27
opensmtpd 6.6.4p1 simple relay config for aws ses
# v20201127
#
# If you edit the files, you have to run "smtpctl update table <aliases|secrets>"
table aliases file:/etc/aliases
table secrets file:/etc/secrets
# To accept external mail, replace with: listen on all
#
listen on localhost
@IanColdwater
IanColdwater / twittermute.txt
Last active May 20, 2026 02:00
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet