Skip to content

Instantly share code, notes, and snippets.

@mcrumm
mcrumm / phx_sqlite_fly_launch.md
Last active March 19, 2025 21:03
Phoenix + SQLite Deployment tips

Deploying to Fly.io with SQLite

Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"

It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd (erm, firecracker) world.

This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari

@andrebrait
andrebrait / keychron_linux.md
Last active March 25, 2025 11:50
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@jimfoltz
jimfoltz / tw5-server.rb
Last active February 15, 2025 17:03
A local server for TiddlyWiki5 that allows saving wiki.
require 'webrick'
require 'fileutils'
BIND_ADDRESS = "127.0.0.1"
PORT = 8080
BACKUP_DIR = 'bak'
if ARGV.length != 0
root = ARGV.first.gsub('\\', '/')
/play
/*.png
/*.bmp
/solitaire