Skip to content

Instantly share code, notes, and snippets.

View cassidoo's full-sized avatar
⌨️
sleepy

Cassidy Williams cassidoo

⌨️
sleepy
View GitHub Profile
@cassidoo
cassidoo / ffmpeg-dark-to-light.md
Last active March 27, 2025 22:01
Instructions to convert a video from dark mode to light mode

Convert a video from dark mode to light mode with FFmpeg!

Let's make it so you can record a demo once in dark mode, and then convert that into light mode, in a single command!

Install FFmpeg

FFmpeg is the brains behind pretty much all video editing softwares. It's a really awesome tool beyond just this use case!

You can go to their downloads page to clone the repo or go into details about how it runs, but here's some shortcuts.

function generateLutFilter(hexColorsToExclude) {
function hexToRgb(hex) {
const bigint = parseInt(hex, 16);
const r = (bigint >> 16) & 255;
const g = (bigint >> 8) & 255;
const b = bigint & 255;
return { r, g, b };
}
let lutFilter = "lutrgb=";
@cassidoo
cassidoo / talk-to-me-template.md
Created December 17, 2024 05:12
A template for a "Talk to Me" page with your crew

Talk to Me page

Who am I?

...

What do I do at organization?

...

@cassidoo
cassidoo / cassidoo-rss-styles.xsl
Created December 15, 2024 21:00
The styles I use for the RSS feed of my website and blog, cassidoo.co
<?xml version="1.0" encoding="utf-8"?>
<!--
# Pretty Feed
Styles an RSS/Atom feed, making it friendly for humans viewers, and adds a link
to aboutfeeds.com for new user onboarding. See it in action:
https://interconnected.org/home/feed

Heading 1

This is an example lil thingy wow look at me!

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
@cassidoo
cassidoo / simple-react-recorder.jsx
Last active March 22, 2025 13:35
A simple React microphone component, recording audio and showing the blob in the browser, styled with Tailwind.
"use client";
import { useState, useEffect, useRef } from "react";
function SimpleRecordButton() {
const [isRecording, setIsRecording] = useState(false);
const [audioStream, setAudioStream] = useState(null);
const [mediaRecorder, setMediaRecorder] = useState(null);
const [audioBlob, setAudioBlob] = useState(null);
const [recordingTime, setRecordingTime] = useState(0);
const timerRef = useRef(null);
@cassidoo
cassidoo / spaces-to-dashes.py
Created July 25, 2024 19:40
A script to replace all of the spaces with dashes in the file and folder names of a directory
# Place this file in the folder that you want to edit, and then run `python spaces-to-dashes.py`
import os
def rename_files_and_folders(root_directory):
for dirpath, dirnames, filenames in os.walk(root_directory, topdown=False):
# Rename files
for filename in filenames:
if ' ' in filename:
old_file_path = os.path.join(dirpath, filename)
@cassidoo
cassidoo / keyboard.json
Last active July 29, 2024 03:58
For the micro journal
{
"main":
[
"ESC", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "BACKSPACE",
"PGUP", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", 127,
"ALT", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "\n",
"SHIFT", "z", "x", "c", "v", " ", "b", "n", "m", ",", ".", "PGDN"
],
"main-shift":
@cassidoo
cassidoo / link-component.astro
Created June 4, 2024 05:43
Astro web component for a random post from a list of slugs
@cassidoo
cassidoo / clearInputs.js
Created March 27, 2024 03:42
Clear all the inputs on the page
function clearInputs() {
let inputs = document.getElementsByTagName("input");
for (const i of inputs) {
i.value = "";
}
}