Skip to content

Instantly share code, notes, and snippets.

@lentil32
lentil32 / sleep_display.zsh
Created October 17, 2024 07:18
Fixed macOS `displaysleepnow` command
#!/usr/bin/env zsh
# =============================================================================
# Script: sleep_display.zsh
# Description:
# Forces the macOS display to sleep properly by preventing it from waking up
# right after being put to sleep. Optionally mutes the system volume or puts
# the entire system to sleep.
#
# Usage:
@lentil32
lentil32 / test.py
Created October 4, 2024 04:35
This script tests all files named <name>.py in the directory.
import os
import subprocess
import sys
BLACKLIST = ["test.py", "main.py"] # TODO Add other files you don't want to test
def run_test_case(script_path, input_data, expected_output):
# Run the external Python script using the current Python interpreter
process = subprocess.Popen(
@lentil32
lentil32 / keybase.md
Created January 31, 2024 10:12
keybase proof