Check out this picture and toggle dark mode or light mode on your GitHub profile to see it change!
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!
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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="; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| let { text, posts } = Astro.props; | |
| --- | |
| <astro-link data-posts={posts}> | |
| <a>{text}</a> | |
| </astro-link> | |
| <script> | |
| class AstroLink extends HTMLElement { |