Skip to content

Instantly share code, notes, and snippets.

View acheong08's full-sized avatar
🎯
Focusing

Antonio Cheong acheong08

🎯
Focusing
View GitHub Profile
@theevilbit
theevilbit / screenshot.m
Last active December 12, 2024 02:41
Make a screenshot on macOS using Objective-C
/*
Compile:
gcc -framework Foundation -framework AppKit screenshot.m -o screenshot
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
int main(void) {
@acheong08
acheong08 / pyextract.py
Last active January 18, 2023 06:01
Extract classes and functions from Python files
import argparse
import json
import ast
from ast import parse,walk
from astor import to_source
def extract_functions(node,is_class=False):
"""Recursively extract function names and code from an AST node."""
functions = {}
for child in walk(node):
@maple3142
maple3142 / README.md
Last active February 21, 2025 07:55
Rootless Tailscale

Running tailscaled

Download static tailscaled binary here

TAILSCALED_SOCKET="/tmp2/$USER/tailscaled.sock"
TAILSCALED_STATE="tailscaled.state"
./tailscaled --tun=userspace-networking --state="$TAILSCALED_STATE" --socket "$TAILSCALED_SOCKET"