Skip to content

Instantly share code, notes, and snippets.

// fontBuffer is the Buffer of the font converted from base64
if (mimeType === 'font/woff2') {
// Check for the trailing 8-byte sequence
// because for SOME REASON Bun.build appends 7E 8A E6 6A DC 28 7D FD
// at the end of SOME WOFF2 fonts and it BREAKS EVERYTHING
const trailingBytes = Buffer.from([0x7E, 0x8A, 0xE6, 0x6A, 0xDC, 0x28, 0x7D, 0xFD]);
if (fontBufferSanitized.length >= 8) {
const last8Bytes = fontBuffer.subarray(fontBufferSanitized.length - 8);
@RichardKanshen
RichardKanshen / .github workflows update-year.yaml
Last active January 2, 2025 17:01
Update footer with new year
name: Update Year
# PLEASE I SWEAR TO GOD DO NOT USE AN ENDLESS SWITCH CASE OR AN ENDLESS TERNARY OR A FUCKING API TO GET THE YEAR
# EITHER JUST GET THE YEAR USING YOUR LANGUAGE'S DATE API
# OR IF YOUR LANGUAGE DOES NOT HAVE A LANGUAGE API (WHICH IF YOU ARE USING JAVASCRIPT, IT ABSOFUCKINGLUTELY HAS)
# USE THIS CRON TO UPDATE THE YEAR IN YOUR SOURCE CODE ON THE FIRST OF JANUARY
# SERIOUSLY YOU DO *NOT* NEED getfullyear.com (WHICH IS NOT EVEN WORKING AS OF WRITING THIS GIST 😭😭😭)
on:
schedule:
- cron: '0 0 1 1 *'
@RichardKanshen
RichardKanshen / package.json
Created November 1, 2024 14:58
Wordpress XML Export 2 JSON + HTML + MD
{
"dependencies": {
"turndown": "^7.2.0",
"xml2js": "^0.6.2"
}
}
@RichardKanshen
RichardKanshen / windowsBoilerplate.bat
Last active October 4, 2024 08:35
Just a simple code to get me started on a new Windows computer quickly :3
@echo off
setlocal enabledelayedexpansion
:: Create downloads directory
set "downloadDir=%USERPROFILE%\Downloads\SoftwareInstalls"
if not exist "%downloadDir%" mkdir "%downloadDir%"