Skip to content

Instantly share code, notes, and snippets.

View StringKe's full-sized avatar

StringKe StringKe

View GitHub Profile
@StringKe
StringKe / install.sh
Created August 15, 2025 22:30
Fast Create PPNode
#!/bin/bash
# PPanel-node Quick Install Script
# Usage: bash install.sh --server https://api.example.com --server-key your-key --node-id 1
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
@StringKe
StringKe / index.tsx
Last active October 30, 2024 06:15
AnyDi For React
import {Container, FC, useInject} from "./ioc-di";
import {ChildValueService, TestService} from "./service";
const App = () => (
<>
<Container.Wrap>
<Test />
<Test2 />
<Test3 />
</Container.Wrap>
@StringKe
StringKe / .zimrc
Last active August 6, 2024 16:32
My ZSH Configuration
zmodule environment
zmodule git
zmodule input
zmodule termtitle
zmodule utility
zmodule duration-info
zmodule git-info
zmodule asciiship
zmodule zsh-users/zsh-completions --fpath src
zmodule completion
@StringKe
StringKe / history.ts
Created April 26, 2024 07:29
[Jotai Atom] jotai atom history based on immer implementation
import {
applyPatches,
enableMapSet,
enablePatches,
produce,
produceWithPatches,
type Objectish,
type Patch,
} from 'immer';
import { atom, useAtom, type PrimitiveAtom } from 'jotai';
@StringKe
StringKe / focusPropAtom.ts
Created April 26, 2024 03:40
[Jotai Atom] Atomic implementations that allow parent objects to be potentially null
type PickProp<T, K> = K extends keyof NonNullable<T>
? T extends undefined
? NonNullable<T>[K] | undefined
: NonNullable<T>[K]
: undefined;
export function focusPropAtom<Store, Result, Key extends keyof NonNullable<Store>>(
baseAtom: WritableAtom<Store, [SetStateAction<Store>], Result>,
path: Key,
) {
@StringKe
StringKe / .zimrc
Last active April 27, 2024 05:38
ZSH Config
zmodule environment
zmodule git
zmodule input
zmodule termtitle
zmodule utility
zmodule duration-info
zmodule git-info
zmodule asciiship
zmodule zsh-users/zsh-completions --fpath src
zmodule completion
@StringKe
StringKe / KeyboardPlugin.ts
Created January 11, 2024 04:01
ShoSho Demo
import { isArray } from 'lodash-es';
import ShoSho from 'shosho';
import type { Artboard } from '../artboard';
import type { Options } from 'shosho';
import { Plugin } from './Plugin';
type Descriptor = {
handler?: Handler;
import Autoplay from 'embla-carousel-autoplay'
function IndexCarouse({ children, ...props }: CarouselProps) {
const mobile = useIsMobile()
const autoplay = React.useRef(Autoplay({ delay: 2000 }))
return (
<AutoCarousel
{...props}
loop={true}