Resize a folder of images so that the maximum dimension is 512px (in width or height).
- Install Pillow:
pip install pillow
import puppeteer from "puppeteer"; | |
import fs from "fs/promises"; | |
import path from "path"; | |
import { fileURLToPath } from "url"; | |
import getPosts from "..."; | |
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | |
async function generateOGImages() { | |
const posts = await getPosts(); |
Click the button and you'll seeeeeee:
(I generated this button with this project here, try it out!)
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.
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="; |
<?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 |
"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); |