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 / dark-light-demo.md
Created April 10, 2025 04:27
A demo of how to make an image adjust for dark mode or light mode on GitHub

Check out this picture and toggle dark mode or light mode on your GitHub profile to see it change!

Fallback image description

Have Copilot give you tips on how to improve as a developer

Click the button and you'll seeeeeee:

Open in GitHub Copilot

(I generated this button with this project here, try it out!)

@cassidoo
cassidoo / base-css.md
Created May 4, 2022 06:37
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;
@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.

@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 / 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 / master-to-main.md
Last active February 6, 2025 20:16
Instructions for `master` to `main` branches

Switch master branch to main branch

Create main branch with history from master

git branch -m master main

Push main branch to GitHub

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 / 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
@cassidoo
cassidoo / mergerefs.jsx
Created January 10, 2023 22:57
Merge refs in React so a component can have more than one ref
export function mergeRefs(refs) {
return (value) => {
refs.forEach((ref) => {
if (typeof ref === "function") {
ref(value);
} else if (ref != null) {
ref.current = value;
}
});
};