Skip to content

Instantly share code, notes, and snippets.

@59de44955ebd
59de44955ebd / idle_win_dark.py
Last active September 29, 2024 12:45
Dark mode for Python's IDLE in Windows 10/11 (hackish proof of concept)
'''
Dark mode for IDLE in Windows 10/11 (hackish proof of concept)
Usage: python idle_win_dark.py <some_file.py>
This will open <some_file.py> in IDLE, using dark mode for the GUI.
Note: the screenshot also uses a custom dark theme inside the editor,
which is just a copy of the official "IDLE Dark" theme with all background
colors changed to dark grey (#282828), and the font changed to Cascadia Code.
@59de44955ebd
59de44955ebd / demo_tkinter_print_windows.py
Last active September 29, 2024 15:32
Minimal demo for native printing (with page setup and print dialog) with Python+Tk in Windows
from tkinter import Tk, messagebox, scrolledtext, Menu, END, BOTH
from ctypes import windll, byref, sizeof, Structure, POINTER
from ctypes.wintypes import (BOOL, DWORD, HDC, HGLOBAL, HINSTANCE, HWND,
INT, LONG, LPARAM, LPCWSTR, LPVOID, POINT, RECT, UINT, WORD)
########################################
# Used constants
########################################
DT_CALCRECT = 1024
LOGPIXELSX = 88
@59de44955ebd
59de44955ebd / bluesky-rss-feed.php
Last active November 4, 2023 07:56
Simple PHP script for generating RSS feeds from Bluesky user posts
<?php
# USAGE:
# https://your.domain/path/to/script?h=[some bluesky handle]
# https://your.domain/path/to/script?h=[some bluesky handle]&reply=exclude
# CONFIG
define('BSKY_HANDLE', '<your full bluesky handle>');
define('BSKY_APP_PASSWORD', '<your bluesky app password>');