Skip to content

Instantly share code, notes, and snippets.

@afh
afh / fontdemo.py
Created March 9, 2026 13:24 — forked from dbader/fontdemo.py
For my Raspberry Pi internet radio project I needed a way to render text suitable for a low resolution monochrome LCD. This article describes how to render 1-bit text using FreeType and Python. See http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Needs freetype-py>=1.0
# For more info see:
# http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
# The MIT License (MIT)
#
# Copyright (c) 2013 Daniel Bader (http://dbader.org)
@afh
afh / badgemagic.py
Last active March 9, 2026 12:22 — forked from dlech/badgemagic.py
Python script to program Fossia BadgeMagic using Bluetooth.
# SPDX-License-Identifier: MIT
# Copyright (c) 2025 David Lechner <[email protected]>
#
# /// script
# dependencies = [
# "bleak",
# ]
# ///
# https://gist.github.com/dlech/24e71cd18ef46ec0c3ad94ffa0fef49a
@afh
afh / tmux_italic.md
Created November 30, 2019 19:23 — forked from gyribeiro/tmux_italic.md
enable italic font on tmux

Installing and configuring dwm on OS X (tested on Mountain Lion, Mavericks)

  1. Install XQuartz.

  2. Install dwm using Homebrew (or whatever):

    brew install dwm
    
  3. Create a xinitrc.d script for dwm:

//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// [email protected]
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
@afh
afh / .rspactor
Created February 12, 2010 10:34 — forked from mislav/.rspactor
# this goes in the $HOME dir
# needs mislav-rspactor v0.6.3 and RSpec 1.3
RSpactor::Runner.class_eval do
alias old_formatter_opts spec_formatter_opts
def spec_formatter_opts
# update this path to where you saved unicode_formatter.rb
old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter"
end
end