Skip to content

Instantly share code, notes, and snippets.

View ycmjason's full-sized avatar
😆

YCM Jason ycmjason

😆
View GitHub Profile
@ycmjason
ycmjason / tsconfig.json
Created October 16, 2025 03:54
hello world
{
"extends": "../../tsconfig.node.json",
"include": ["src/**/*", "bin/**/*"]
}
@ycmjason
ycmjason / .gitignore
Created October 16, 2025 03:52
hello world
node_modules
dist
.DS_Store
.env
# Ignore the output video from Git but not videos you import into src/.
out
.secrets
.cache
@ycmjason
ycmjason / gist:b1ea2a3abaa0e508ad56dfaf34e1fde4
Created October 15, 2025 05:16
mission-to-zog data url
This file has been truncated, but you can view the full file.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAMACAYAAADljs1tAAAQAElEQVR4AUT9B4BlR3Hvj3+r+4QbJs/ubM45SrsrrbIEikgiipxMztjGAYxtDM444AQmGWywn/0wYH4YPxvDM5ick0BCOafd1cbJc8M59f/0Xfz+d6Zv9+muXNXV4cxK4Suf+7h//t/+yT/7/33EP/fpj/qnP/ZB/8Q/vN8/9tH3+gfe84f+53/6Nn/Xu97mb//tX/Fff9sv+pt//ef9Za96id/07Kf7s577VH/eC57uz6E87Vk3+JOf8ST6nuwvfNEz/anPuM6fdMMT/IYbr/TrqVO59kmX+bXXXe5Puekp/qyXvc6f97o3+7Nf8fN+00tf489+2av92S99pT/tuS/wa2+80a+66ol+7dVX+HXXXOE3XvsEf9JV4D7xIr/+yov9SVde5NddcYFfz/O11NdR30B50hMuoP98v/bys2M3Xn2JP+XKS/zGJ1zoN1x+vj/tygv9Gddc5M+8+iJ/9jUX+otuuMxf/ORL/fk3XOrPvfZyfw58nn/9Ff6i6y/3F113qT/viYf9qeA99dIL/bduOux3fODFvvAfr/eZf3+Nz33ujV594Ze8/vKv+L3vfp7/+lMP+00Xn+NPu+QAOAf8BtrXX3yuP/myg/60K87z687f71cf2uPXXLjfn3j4XD98/rl+0bm7/befd6n/8C9e4re9/7X+By95kl+8b6sfPnePX3b4HL/k0H6/8MB+2of8sgsO+cWHD/lFqZx/EJh9ftmF9F90nl9w6ICff95B37d/n+/Yvct379vl+87Z53v27fGde3b7LsrOPXt9z+49/syLDvml9G/esdN37tztO6hT2bl9u193wV7/s1c80Z99xQFfuW6rb928zc/dvtvP3bXXz9220w9s3eYX7tvnT7zoQj947nm+eesO37hlq+8E5pxd+/2c3ef4oXMODcr+XXt8D/gXIM9VyH7RgQO+bctOcHb7lm17fO
@ycmjason
ycmjason / Icon.tsx
Created February 11, 2025 21:59
expo-icon FontAwesome 5 / 6 type safe icon component
import type { createIconSet } from '@expo/vector-icons';
import Untyped_FontAwesome6 from '@expo/vector-icons/FontAwesome6';
import type { FA6Style } from '@expo/vector-icons/build/FontAwesome6';
import type { ComponentProps, ReactNode } from 'react';
type FA6Variant = keyof typeof FA6Style;
type IconComponent = ReturnType<typeof createIconSet<string, string>>;
const FontAwesome6: IconComponent = Untyped_FontAwesome6;
export const Icon = ({
@ycmjason
ycmjason / PartialLoadingBar.tsx
Last active October 27, 2024 13:29
Deno Fresh Partial Fetch Events
import { useSignal } from "@preact/signals";
import { useEffect } from "preact/hooks";
export const PartialLoadingBar = () => {
const loadState = useSignal<"loading" | "loaded" | "not-loading">(
"not-loading",
);
useEffect(() => {
const onBeforePartialFetch = () => {
loadState.value = "loading";
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type ExclusiveUnion<T> = KeysOfUnion<T> extends
infer K extends PropertyKey
? T extends infer A ? A & Partial<Record<Exclude<K, keyof A>, never>>
: never
: never;
@ycmjason
ycmjason / README.md
Created July 6, 2024 11:30
async queue with async generator

with this async generator queue, you could make sure the tasks given are run with at a maximum concurrency

@ycmjason
ycmjason / rerenderable.kt
Created April 27, 2024 23:55
A composable that allow particular block to be rerendered manually
@Composable
fun <T> rerenderable(
beforeRerender: () -> Unit = {},
block: @Composable (rerender: () -> Unit) -> T,
): () -> Unit {
var id by remember { mutableStateOf(0) }
val rerender = {
beforeRerender()
id += 1
}
@ycmjason
ycmjason / LazyListScope.itemsWithDivider.kt
Created April 20, 2024 22:41
List item with divider
package app.fishball.taskshuffle.ui.components.contextless
import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.runtime.Composable
inline fun <T> LazyListScope.itemsWithDivider(
items: List<T>,
noinline divider: (@Composable LazyItemScope.(left: T, right: T) -> Unit),
@ycmjason
ycmjason / .prettierrc.json
Created October 26, 2023 09:54
Best Prettier Config In The World
{
"printWidth": 100,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid"
}