Skip to content

Instantly share code, notes, and snippets.

@grqz
grqz / fn_to_block.h
Created September 3, 2025 00:56
Magically converts a C function pointer(with user data) into a Objective-C block. Note that block->isa needs to be set up manually before the make_wrapper call.
#ifndef FN_TO_BLOCK_H
#define FN_TO_BLOCK_H
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
// See: https://clang.llvm.org/docs/Block-ABI-Apple.html#high-level
@grqz
grqz / pot.js
Last active March 19, 2025 04:51
a messy one-file youtube POT generator JS, based on bgutils
// the only dependency on node js
import { JSDOM } from 'jsdom';
const dom = new JSDOM();
Object.assign(globalThis, {
window: dom.window,
document: dom.window.document
});
@grqz
grqz / ArgParse.h
Last active November 25, 2024 01:52
a simple c++ argument parser (WIP), requires c++17 or higher
/*
* ArgParse v5
*/
#ifndef ARGPARSE_H
#define ARGPARSE_H
#include <any>
#include <cstdint>
#include <cstring>
#include <exception>
@grqz
grqz / install.bat
Created July 16, 2024 11:06
warp wgcf&wireguard install script for windows
@echo off
cd %USERPROFILE%/Downloads/
mkdir wgcf 2>nul
cd wgcf
echo Downloading wgcf...
curl -GSLZs "https://github.com/ViRb3/wgcf/releases/download/v2.2.22/wgcf_2.2.22_windows_amd64.exe" -o wgcf.exe
echo Generating key...
wgcf register & wgcf generate