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
import { cva } from "cva"; | |
export * from "cva"; | |
type Base = Parameters<typeof cva<unknown>>[0]; | |
type Config<T> = Parameters<typeof cva<T>>[1]; | |
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {}; | |
type Props<T> = Simplify< | |
Omit< | |
Exclude<Parameters<ReturnType<typeof cva<T>>>[0], undefined>, |
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
import * as React from "react"; | |
import { expect, test } from "vitest"; | |
import { makeDynamicComponent } from "./dynamicComponent"; | |
type NoProps = object; | |
const ComponentA1 = (_: { req: "a"; opt?: "a" }) => null; | |
const ComponentA2 = (_: { req: "a"; opt?: "a" }) => null; | |
const ComponentB = (_: { req: "b"; opt?: "a" }) => null; | |
const ComponentC = (_: { opt?: "a" }) => 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
#!/usr/bin/env python3 | |
# /// script | |
# dependencies = [ | |
# "mistune==3.0.2", | |
# ] | |
# /// | |
import os | |
import sys | |
import hashlib |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Safari Animation.commitStyles() CSP Bug</title> | |
<!-- CSP that triggers the bug - style-src-attr 'self' only --> | |
<meta http-equiv="Content-Security-Policy" content="style-src-attr 'self'"> | |
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
//! Proof of concept of a tokio::sync::watch-style channel with WeakSender support | |
//! Copyright Ryan Patterson - MIT license | |
use std::sync::{ | |
atomic::{AtomicUsize, Ordering}, | |
Arc, RwLock, RwLockReadGuard, TryLockError, Weak, | |
}; | |
use tokio::sync::Notify; | |
/// Thread-safe reference-counted reader-writer lock with change notification. | |
/// |
OlderNewer