Skip to content

Instantly share code, notes, and snippets.

@acorn1010
acorn1010 / createGlobalStore.ts
Last active October 5, 2024 21:56
Easier Zustand store
import {SetStateAction, useCallback} from 'react';
import {create} from "zustand";
export type EqualityFn<T> = (left: T | null | undefined, right: T | null | undefined) => boolean;
export type StoreType<State> = {
use<K extends keyof State>(
key: K,
defaultValue?: State[K],
equalityFn?: EqualityFn<State[K]>,
@acorn1010
acorn1010 / wsl2_firewall_hole_puncher.bat
Created July 20, 2022 14:09
WSL2 Firewall Hole Puncher
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}