The following guide will show you how to connect a local model served with MLX to OpenCode for local coding.
1. Install OpenCode
curl -fsSL https://opencode.ai/install | bash
| # /// script | |
| # requires-python = ">=3.13" | |
| # dependencies = [] | |
| # /// | |
| import re | |
| import sys | |
| from collections import defaultdict | |
| from dataclasses import dataclass | |
| from pathlib import Path |
| """ | |
| Render Image in iTerm2 without pixelization | |
| This small snippet is ported from https://github.com/sindresorhus/ansi-escapes. | |
| It leverages iTerm2's image protocol: https://iterm2.com/documentation-images.html | |
| so it only works on iTerm2. | |
| Released to the public domain, feel free to copy and modify. | |
| - Frost Ming | |
| """ |
| #!/bin/bash | |
| cat <<EOF | |
| Rewriting current branch to master, by applying black. | |
| This is only tested for simple, linear branches and results should | |
| be checked thoroughly before abandoning the old history. | |
| EOF | |
| # Find out the combined base commit |
| FROM ubuntu:xenial | |
| MAINTAINER alex | |
| # update and install dependencies | |
| RUN apt-get update \ | |
| && apt-get install -y \ | |
| software-properties-common \ | |
| wget \ | |
| && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ | |
| && apt-get update \ |
Update on Nov 30, 2025: This Gist is nearly eight years old! These instructions worked back in 2018 for the Pi 3, but recent comments suggest that they may not be sufficient on more recent Pi models and newer versions of Raspberry Pi OS. Be advised.
On my RetroPie machine I wanted a hardware volume knob — the games I play use a handful of emulators, and there's no unified software interface for controlling the volume. The speakers I got for my cabinet are great, but don't have their own hardware volume knob. So with a bunch of googling and trial and error, I figured out what I need to pull this off: a rotary encoder and a daemon that listens for the signals it sends.
| # The entries in this file are checked regularly for validity via the Github Action | |
| # sited at github.com/bskinn/intersphinx-gist. | |
| # Please feel free to post an issue at that repo if any of these mappings don't work for you, | |
| # or if you're having trouble constructing a mapping for a project not listed here. | |
| Python 3 [latest]: ('https://docs.python.org/3/', None) | |
| Python 3 [3.x]: ('https://docs.python.org/3.9/', None) | |
| attrs [stable]: ('https://www.attrs.org/en/stable/', None) | |
| Django [dev]: ('https://docs.djangoproject.com/en/dev/', 'https://docs.djangoproject.com/en/dev/_objects/') | |
| Flask [2.2.x]: ('https://flask.palletsprojects.com/en/2.2.x/', None) |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| # Source: https://gist.github.com/5212628 | |
| # | |
| # All-purpose gist tool for Pythonista. | |
| # | |
| # When run directly, this script sets up four other scripts that call various | |
| # functions within this file. Each of these sub-scripts are meant for use as | |
| # action menu items. They are: | |
| # | |
| # Set Gist ID.py - Set the gist id that the current file should be | |
| # associated with. |