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 / 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 December 20, 2024 03:54
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 = "";
}
}
@cassidoo
cassidoo / tauri-file-diff.js
Created March 21, 2024 21:05
A script for a Tauri application to iterate over files and generate new file names and not overwrite old ones
const { BaseDirectory, exists } = window.__TAURI__.fs;
async function doesFileExist(fileName) {
let fileExists = await exists(fileName + ".pdf", {
baseDir: BaseDirectory.Download,
});
let fileCounter = 0;
while (fileExists) {
fileCounter++;
@cassidoo
cassidoo / wrapunicodespangpt4.md
Last active February 18, 2024 21:24
A GPT-4 prompt to write a simple JavaScript function

Prompt: Write a function in JavaScript that wraps a Unicode character in an HTML document in a <span> tag with a CSS class.


Raw GPT-4 Output:

You can use the following JavaScript function to achieve this:

function wrapUnicodeCharacter(char, cssClass) {