Skip to content

Instantly share code, notes, and snippets.


Frank Rausch frankrausch

View GitHub Profile
frankrausch / SFUI-HighLegibilityFontDescriptor.swift
Created May 26, 2020
UIFontDescriptor for SF UI high-legibility figures
View SFUI-HighLegibilityFontDescriptor.swift
func fontDescriptorWithHighLegibilityMonospacedFigures(for fontDescriptor: UIFontDescriptor) -> UIFontDescriptor {
return fontDescriptor.addingAttributes(
[ // High legibility 6 and 9
UIFontDescriptor.FeatureKey.featureIdentifier: kStylisticAlternativesType,
UIFontDescriptor.FeatureKey.typeIdentifier: kStylisticAltOneOnSelector,
[ // High legibility 4
frankrausch / gist:572a3368c50b77be854265a8c91a77b2
Created May 13, 2020
Convert UIKeyCommand from deprecated init syntax to iOS 13 SDK syntax
View gist:572a3368c50b77be854265a8c91a77b2
# Regex:
UIKeyCommand\(input: (.+)\, modifierFlags: (.+), action: #selector\((.+)\), discoverabilityTitle: (.+)\),
# Replace:
UIKeyCommand(title: $4,
image: nil,
action: #selector($3),
input: $1,
modifierFlags: $2,
propertyList: nil,
View Typesetting Libraries and

Typesetting Libraries and Plugins

These are tools that improve typographic details like microtypography and typographic syntax automatically.

Additions welcome!

Name Language/Platform
JoliTypo PHP
PHP SmartyPants PHP
View FR.alfredappearance
"alfredtheme" : {
"result" : {
"textSpacing" : 4,
"subtext" : {
"size" : 12,
"colorSelected" : "#FFFFFFFF",
"font" : "CamingoCode",
"color" : "#7F7F7FFF"
frankrausch / Alfred Create New File.scpt
Last active Mar 22, 2019
Alfred Workflow AppleScript to create an empty file in the current Finder window
View Alfred Create New File.scpt
on alfred_script(q)
set title to "Untitled.txt"
if q is not equal to "" then set title to q
tell application "Finder" to make new file at (the target of the front window) as alias with properties {name: title}
end alfred_script
frankrausch /
Last active Sep 17, 2022
Slow down or speed up all MP3 files in a folder with FFmpeg.
mkdir "speed-${speed}x"
for f in *.mp3
do ffmpeg -i "$f" -filter:a "atempo=${speed}" "./speed-${speed}x/$f"
frankrausch / CustomDocumentWindow.swift
Last active Sep 4, 2018
Prevent NSPopover from stealing an NSTextField’s focus when using the popover to display live search results. Swift adaption of Wil Shipley’s solution (
View CustomDocumentWindow.swift
protocol PopoverFirstResponderStealingSuppression {
var suppressFirstResponderWhenPopoverShows: Bool { get }
class CustomDocumentWindow: NSWindow {
override func makeFirstResponder(_ responder: NSResponder?) -> Bool {
if responder != self.firstResponder,
let newFirstResponder = responder as? NSView {
let newFirstResponderWindow = newFirstResponder.window
frankrausch /
Last active Dec 16, 2017
Compile individual SVG icons into one SASS file as data URIs
echo "Compiling icons from "$sourceFiles" into "$destFile""
echo "" > $destFile
for fileWithPath in ../assets/icons/*.svg;
contents=$(cat $fileWithPath)
frankrausch / String+Hyphenation.swift
Last active Sep 6, 2022
Returns a String with soft hyphens (U+00AD)
View String+Hyphenation.swift
import Foundation
extension String {
func hyphenated(languageCode: String) -> String {
let locale = Locale(identifier: languageCode)
return self.hyphenated(locale: locale)
func hyphenated(locale: Locale) -> String {