Skip to content

Instantly share code, notes, and snippets.

View RhetTbull's full-sized avatar

Rhet Turnbull RhetTbull

View GitHub Profile
@RobertAKARobin
RobertAKARobin / safari.md
Last active December 5, 2024 01:38
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

@yogthos
yogthos / README.md
Last active March 24, 2024 10:35
command line util for grabbing current weather for a city using OpenWeather API

usage

Create an account at https://openweathermap.org and get an API key. Note that it can take up to a couple of hours for the key to become active. Add an environment variable OPEN_WEATHER_API_KEY with the value of the key.

run the script:

./weather.clj Toronto,CA
@samuelcolvin
samuelcolvin / python-people.md
Last active August 29, 2025 11:09
An incomplete list of people in the Python community to follow on Twitter and Mastodon.

Python People

(Updated 2022-11-16 with suggestions from comments below, Twitter and Mastodon)

An incomplete list of people in the Python community to follow on Twitter and Mastodon.

With the risk that Twitter dies, I'd be sad to lose links to interesting people in the community, hence this list.

I would love you to comment below with links to people I've missed.

@peterc
peterc / screencastocr.py
Created October 25, 2022 22:15
Scan screencast videos for (sensitive) text – ROUGH WORK IN PROGRESS
# Scan screencast videos for (sensitive) text
# MIT licensed – Copyright (c) 2022 Peter Cooper – @cooperx86
# Quite a bit of the code comes from
# https://github.com/RhetTbull/osxphotos/blob/master/osxphotos/text_detection.py
# which is itself MIT licensed and copyright (c) 2019-2021 Rhet Turnbull
import tempfile
import subprocess
@eyeseast
eyeseast / python.md
Last active May 25, 2025 08:27
How to set up Python in 2022

I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links:

  • Python docs: https://docs.python.org/3/
  • Python Standard Library:  - Start here when you're trying to solve a specific problem
@ssrihari
ssrihari / clojure-learning-list.md
Last active September 1, 2025 23:19
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@RhetTbull
RhetTbull / qrcodes.py
Created September 5, 2022 20:22
Detect QR codes in python on MacOS using CoreImage API via PyObjC
"""Uses CoreImage API via PyObjC to detect QR Codes in images on MacOS.
This is a simple wrapper around the CIDetector API and only returns the text of the QR Code.
It does not return the location of the QR Code in the image.
Reference: https://developer.apple.com/documentation/coreimage/cidetector/detector_types?language=objc
"""
from typing import List
@RhetTbull
RhetTbull / fmydocstrings.py
Last active April 18, 2023 23:50
Python decorator to allow use of f-strings in docstrings (something not normally supported by Python)
"""Simple decorator that applies f-string formatting to docstrings
To use, simply apply `@fmydocstring` to your function
Only global variables are accessible for interpolation.
"""
import functools
from datasette import hookimpl
from datasette.utils.asgi import Response
import os
REDACT = {"GPG_KEY"}
async def env(request):
output = []
for key, value in os.environ.items():
import sys
# Prints a list of digits to stdout
def emit(digits: list[int], newline:bool = False) -> None:
for i in digits:
print(i, end='')
if newline:
print()