Skip to content

Instantly share code, notes, and snippets.

// useful links:
// custom easing by Lochie (x.com/lochieaxon): https://www.easing.dev
// motion-primitives by Ibelick (x.com/Ibelick): https://motion-primitives.com/docs
// The Magic of Clip Path article by Emil Kowalski (x.com/emilkowalski_): https://emilkowal.ski/ui/the-magic-of-clip-path
// we use same transition for every element to make it look consistent
const transition: Transition = {
duration: 2.5,
// custom easing from https://www.easing.dev
ease: [0.175, 0.885, 0.32, 1],
@alexanderbuhler
alexanderbuhler / README.md
Last active June 30, 2025 09:13
Tailwind v4 polyfill / browser compatibility configuration

This gist may be your full solution or just the starting point for making your Tailwind v4 projects backwards compatible.

What it does

  • Convert @property rules into good old CSS vars
  • Pre-compute oklab() functions
  • Pre-compute color-mix() functions (+ replace CSS vars inside them beforehand)
  • Remove advanced instructions (colorspace) from gradients
  • Provide support for nested CSS (used by dark mode or custom variants with &)
  • Transform translate, scale, rotate properties to their transform: ... notation
  • Add whitespace to var fallbacks var(--var,) > var(--var, ) to help older browsers understand
@jake9696
jake9696 / gist:4828158564a2fbb40dead5b2751687c1
Last active February 13, 2025 11:21
Novelcrafter book generation with Story Architect System
This is a comparison of the output from four different LLMs when writing a short story with a total word count target of 9,000 words.
It was generated using the Story Architect System prompt system from Jordan on the Novelcrafter discord.
https://discord.com/channels/1133311989792387162/1327397149616504993
Using those prompts, I took my initial random idea that I had made up on the spot in one of my Story Hacker Gold group posts:
https://www.skool.com/story-hacker/good-news-from-the-copyright-office?p=7c478988
```
Jake Carr
• 4d
@kalomaze
kalomaze / scrambled_text.md
Created January 6, 2025 21:28
scrambled text example

Original Text ("Reading a Sign 43 Times Heals Your Axe Durability" by Hunter R.)

We all know that the axe in Animal Crossing will usually break after using it too much. Of course, the axe is intentionally designed to break like this in order to make the unbreakable Golden Axe an appealing item to unlock. And yet what if I told you that by simply reading a sign over and over you can actually prevent your standard axe from ever breaking? And no, I'm not joking—you can actually sit here and read this sign over and over to heal the durability on your axe, making it theoretically invincible. I'm sure a lot of you are wondering how or why this even works, so let's take a closer look.

Creating an unbreakable axe is a really funny glitch that was recently discovered by Animal Crossing spreadsheet owner Phil. To understand how interacting with a sign heals your axe, let's discuss how axe durability works.

Normally an axe can withstand 72 hits on normal trees before breaking. Since trees take three hits to cut
@alexdebrie
alexdebrie / .zshrc
Created December 9, 2024 15:26
PSQL to DSQL
function dsql {
local auth_token
auth_token=$(aws dsql generate-db-connect-admin-auth-token \
--region us-east-1 \
--expires-in 3600 \
--hostname CLUSTER_ENDPOINT_URL) || { echo "Failed to generate auth token" >&2; return 1; }
if [ -z "$auth_token" ]; then
echo "Auth token is empty" >&2
return 1
@JayPeet
JayPeet / OpenAI_Nginx_DenyList
Created September 4, 2024 20:48
Nginx OpenAI Deny List
# IPs taken from:
# https://openai.com/searchbot.json
# https://openai.com/chatgpt-user.json
# https://openai.com/gptbot.json
# And presumably could change.
location /
{
#deny OAI-SearchBot
deny 20.42.10.176/28;
@okikio
okikio / constrain-transform-stream-queues.md
Last active December 7, 2024 03:04
Queue's via TransformStreams

Using TransformStream in place of traditional queue implementations is an interesting approach that leverages the stream API's natural queuing and backpressure features. Below is a breakdown of how you might implement each queue type using TransformStream, adhering to the constraint of using no more than 2 TransformStreams per queue, and addressing any limitations that arise.

1. Simple Queue (FIFO Queue)

  • Implementation:
    • TransformStream 1: This stream simply passes data from the writable side to the readable side in FIFO order.
    • TransformStream 2: Not necessary in this case, as one TransformStream is sufficient to maintain the FIFO order.
const fifoQueue = new TransformStream(undefined, undefined, { highWaterMark: Infinity });
@hanxiao
hanxiao / testRegex.js
Last active June 28, 2025 00:11
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@astuyve
astuyve / deny_snippet.json
Created January 17, 2024 15:00
Deny cloudwatch permissions from Lambda to save money
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active June 27, 2025 00:20
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion: