Skip to content

Instantly share code, notes, and snippets.

View BasixKOR's full-sized avatar

Sung Jeon BasixKOR

View GitHub Profile
@ellemedit
ellemedit / README.md
Created June 19, 2024 06:45
A ReactDOM hook that allows you to reset form optionally after submitting

Example:

function Form() {
  const [isPending, onSubmit] = useFormActionHandler((formData, reset) => {
    if (formData.get('condition') === 'X') {
      reset();
    }
    // ...
 });
@thesamesam
thesamesam / xz-backdoor.md
Last active April 21, 2026 01:58
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@NyanSatan
NyanSatan / t8120-ap_keys-210124.json
Created January 21, 2024 16:47
T8120 AP & SEP keys 21.01.24
[
{
"build": "20A362",
"fw": "iPhone15,2_16.0_20A362_Restore.ipsw",
"file": "LLB.d73.RELEASE.im4p",
"kbag": "985898593B143B130AAEA95C723A342D647ED5F9E0953871E836000A7108E52D75E0BA03A9917E984889DCA1253D3F1C",
"key": "9f58969bb426e99f2dc541bd524f2b5696865560a201a230ee25c89cd2a147d9e5d17779c0b816fd29c5f760a892c5bf"
},
{
"build": "20A362",
@WebReflection
WebReflection / proxy-traps-cheat-sheet.md
Last active April 18, 2026 18:40
Proxy Traps Cheat Sheet

Proxy Traps Cheat Sheet

There are various shenanigans around the Proxy API, including issues with Array.isArray and Object.ownKeys so that this gits purpose is to describe all the undocummented caveats to help anyone dealing with all possibilities this half-doomed API offers.

The 3 + 1 Proxy Types

  • object: any non primitive value can be proxied but apply and construct traps won't work with it. If the object somehow wants to represent an array without being one, it's impossible to survive Array.isArray brand check (it will be false) and with ownKeys the target needs to have a non configurable length property or it will also fails once reached
  • array: it's like object but it survives the `
@JLarky
JLarky / IsolateCSS.tsx
Last active July 10, 2023 09:23
How to use shadow dom to isolate CSS of React component https://twitter.com/JLarky/status/1657989891526123520
export function IsolateCSS(props: { children: React.ReactNode }) {
const onceRef = useRef(false);
const [shadowRoot, setShadowRoot] = useState<ShadowRoot>();
const ref = useCallback((ref: HTMLDivElement | null) => {
if (ref && onceRef.current === false) {
onceRef.current = true;
setShadowRoot(ref.attachShadow({ mode: 'open' }));
}
}, []);
@hyperupcall
hyperupcall / settings.jsonc
Last active March 17, 2026 09:13
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@kconner
kconner / macOS Internals.md
Last active April 24, 2026 22:41
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@wojtekmaj
wojtekmaj / jest-to-vitest.sh
Last active February 2, 2026 23:05
Automatically migrate Jest project to Vitest
#!/bin/bash
# Ensure we're working on the latest version of the main branch
git switch main
git fetch
git pull
# Create a new branch
git switch -c vitest
// ==UserScript==
// @name ASTx2 Emulator
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author @BawAppie
// @match https://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=ahnlab.com
// @grant none
// ==/UserScript==