Skip to content

Instantly share code, notes, and snippets.

View composite's full-sized avatar
🤡
와이 쏘 씨리우스야 씨벌로마.

Ukjin Yang composite

🤡
와이 쏘 씨리우스야 씨벌로마.
View GitHub Profile
@composite
composite / OneDialog.tsx
Last active July 9, 2024 09:09 — forked from alexanderson1993/AlertDialogProvider.tsx
A multi-purpose alert/confirm/prompt replacement built with shadcn/ui AlertDialog components. No Context, SSR friendly, Also works on Next.js and Remix, but requires React 18 or later due to useSyncExternalStore.
'use client';
import * as React from 'react';
import {
AlertDialog,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
@composite
composite / wsl2-network.ps1
Last active June 10, 2024 02:10 — forked from daehahn/wsl2-network.ps1
WSL 2 TCP NETWORK FORWARDING, IMPROVED FOR TASK SCHEDULER! ALSO WORKS ON WINDOWS SERVER 2022!
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# edited by Ukjin Yang, Jun-7-2022 (Windows Server 2022 also works!)
# Improved features: more detailed logs for Task Scheduler, saved IP check, etc.
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
@composite
composite / OpenWithAtomAsAdmin.bat
Last active December 30, 2015 01:25 — forked from jcppkkk/OpenWithSublime.bat
Add context menu to allow user open file or folder with Atom as User or Admin. Save the raw file OpenWithAtomAsAdmin.bat into sublime folder and execute it. Forked and elevate as admin script by https://gist.github.com/jcppkkk/8330314
@echo off
@rem \"%stPath%\" : Path to Sublime Text installation dir.
@rem %UserEntry%: Key name for the registry entry.
@rem %UserMenuText% : Context menu text. Set your preferred menu text (e.g.: translate to your language).
@rem %AdminEntry%: Key name for the registry entry.
@rem %AdminMenuText% : Context menu text. Set your preferred menu text for administrator privilege (e.g.: translate to your language).
SET stPath=%~dp0atom.exe
SET UserEntry=Atom
SET AdminEntry=Atom As Admin
@composite
composite / AttributeDriver.cs
Last active November 11, 2015 07:57 — forked from puryfury/AttributeDriver.cs
Nancy Attrubute-Driven Module Example (Nancy 1.x or above, targeted as .NET 4.5 or later.)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
namespace Nancy
{