Skip to content

Instantly share code, notes, and snippets.

@xchellx
xchellx / serve.py
Created August 8, 2021 08:10
Python CORS HTTP localhost web dev server script (includes logging to file)
#!/user/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -http.server 8000` when you need CORS"""
from sys import stdout
from datetime import datetime
from http.server import HTTPServer, SimpleHTTPRequestHandler
from atexit import register as atexit
# For logging (to both console and file)
@xchellx
xchellx / exitlistener.py
Created June 6, 2022 08:14
CORS-supported alternative to `py -3 -m http.server 8000`
#!/usr/bin/env python3
# encoding: utf-8
# Absolute TRUE process exit handling (atexit is psuedo-atexit, this is TRUE atexit!)
__all__ = ['register','unregister']
import sys
import os
from pathlib import Path
@xchellx
xchellx / Register_Paint.NET.reg
Last active June 7, 2023 13:47
Registers Paint.NET (so the .pdn Shell Extension works). You must run regedit as TrustedInstaller to import this (use https://github.com/M2TeamArchived/NSudo for this.
Windows Registry Editor Version 5.00
; You must run regedit as TrustedInstaller to import this
; Use https://github.com/M2TeamArchived/NSudo to do this
; Application Registration
[HKEY_CLASSES_ROOT\paint.net.1]
@="paint.net Image"
"FriendlyTypeName"="paint.net Image"