Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Madlon-Kay amake

View GitHub Profile
@amake
amake / main.log
Created Nov 20, 2020
Sequel-Ace MacPorts build error
View main.log
DEBUG: macOS 10.15 (darwin/19.6.0) arch i386
DEBUG: MacPorts 2.6.4
DEBUG: Xcode 12.2
DEBUG: SDK 10.15
DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.15
DEBUG: Executing org.macports.main (Sequel-Ace)
DEBUG: dropping privileges: euid changed to 502, egid changed to 501.
DEBUG: fetch phase started at Fri Nov 20 17:38:02 JST 2020
---> Fetching distfiles for Sequel-Ace
DEBUG: Executing org.macports.fetch (Sequel-Ace)
@amake
amake / org-babel-tramp.org
Last active Sep 5, 2020
org-babel + tramp demonstration
View org-babel-tramp.org

This file demonstrates using org-babel and tramp together to execute a source block on a remote host. It was tested with Emacs 27.1 launched as emacs -Q (zero custom configuration).

I recommend that you download the raw version of this file, open it in Emacs, and evaluate the blocks yourself. In fact, if you don’t then you will miss the most important parts because they are hidden in the fancy GitHub rendering.

@amake
amake / katex-to-png-ios.swift
Last active Jun 30, 2020
Generate math PNGs on iOS with KaTeX (Xcode Playground)
View katex-to-png-ios.swift
import UIKit
import WebKit
import PlaygroundSupport
var html = """
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
@amake
amake / Makefile
Last active May 17, 2021
Convert HEIC images to MP4 video
View Makefile
SHELL := /bin/bash
# Requires ffmpeg, libheif
heic := $(wildcard *.HEIC)
jpg := $(heic:.HEIC=.jpg)
.PHONY:
all: silent-pingpong.mp4 with-audio-pingpong.mp4
@amake
amake / tikal.pom.xml
Created Dec 3, 2019
Run Okapi Tikal install-less with Maven
View tikal.pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Execute tikal with Maven: mvn -q -f tikal.pom.xml exec:java -Dexec.args=-h -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.lake</groupId>
<artifactId>tikal</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
@amake
amake / omegat.pom.xml
Last active Jul 2, 2021
Run OmegaT install-less with Maven
View omegat.pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Execute OmegaT with Maven: mvn -q -f omegat.pom.xml exec:java -Dexec.args=-h -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.omegat</groupId>
<artifactId>omegat-run</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
@amake
amake / innosetup-linux-macos.org
Last active Oct 15, 2021
Inno Setup on Linux and macOS
View innosetup-linux-macos.org

Inno Setup on Linux and macOS

Inno Setup is a popular installer builder for Windows. Of course it is made to run on Windows only, by default. But what if you want to build Windows installers off Windows, i.e. on Linux or macOS?

You’re in luck: It’s possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

@amake
amake / Makefile
Last active Jan 4, 2019
`make test` to generate initialisms for Japanese place names, e.g. 池袋 → E. K. Bukuro
View Makefile
vendor:
mkdir -p $(@)
NOUN_DATA := vendor/Noun.place.csv
NOUN_DATA_URL := https://raw.githubusercontent.com/taku910/mecab/master/mecab-ipadic/Noun.place.csv
$(NOUN_DATA): | vendor
curl $(NOUN_DATA_URL) | iconv -f EUC-JP -t UTF-8 > $(@)
ENV := .env
@amake
amake / fliptext.py
Last active Aug 9, 2017
macOS Services
View fliptext.py
# -*- coding: utf-8 -*-
import re
from sys import stdin, stdout
wspace = re.compile(r'^(\s*)(.*?)(\s*)$')
pchars = (u'ACDEFGJLMNPRTUVWY'
u'abcdefghijklmnpqrstuvwy'
u",.?!'()[]{}‿∴¯_ツ")
@amake
amake / android-7-localization.org
Last active Sep 28, 2021
Correct localization on Android 7
View android-7-localization.org

Correct localization on Android 7

Prior to Android 7, the system had a single preferred locale, and fallback behavior was quite rudimentary. Starting with Android 7, the user can now specify a priority list of locales, and fallback behavior is improved.

However, in many cases it is still surprisingly difficult to make full use of locale fallback, and there are some hidden gotchas when trying to fully support both Android 7 and earlier versions.