| // | |
| // FreeSpaceViewController.swift | |
| // Free Space | |
| // | |
| // Created by Kyle Howells on 04/05/2022. | |
| // | |
| import UIKit | |
| class FreeSpaceViewController: UIViewController { | 
| #!/bin/bash | |
| gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont' | 
| #!/Users/samuelkordik/.pyenv/shims/python | |
| # ReadingListCatcher | |
| # - A script for exporting Safari Reading List items to Markdown and Pinboard | |
| # Originally by Brett Terpstra 2015, <https://brettterpstra.com/2015/01/06/reading-list-catcher/> | |
| # Modifications by Zach Fine made in 2020 to use the original reading list item in the | |
| # posts to pinboard. | |
| # Updated 2021-06-21 by Samuel Kordik to fix errors due to deprecated API in plistlib, | |
| # changes to Pinboard api and Pinboard python lib; added enhanced logging output | |
| # and error handling to work as a cron job or shell script. | |
| # Uses code from <https://gist.github.com/robmathers/5995026> | 
| @layer utilities { | |
| .text-gradient { | |
| background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| } | |
| } | 
| -- HANDLE SCROLLING WITH MOUSE BUTTON PRESSED | |
| local scrollMouseButton = 3 | |
| local deferred = false | |
| overrideOtherMouseDown = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(e) | |
| -- print(hs.eventtap.event.properties['mouseEventButtonNumber']) | |
| local mouseButton = e:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber']) | |
| if mouseButton == scrollMouseButton then | |
| deferred = true | |
| return true | 
There is an ongoing shift in programming towards a more constrained mindset, recognizing shared mutable state and side effects as significant sources of accidental complexity and concepts like immutability and reactive, unidirectional pipelines as ways to overcome it. Simplicity is less optional than before, based on an understanding about the limited capacity of human working memory and based on programming language theory and practice. The functional programming ideas seeping into the mainstream leave less people to say that they wouldn't need them because of maybe never having used them.
The basic idea of controlling complexity through constraints is not novel at all, though, and it raises a valid question about why this shift has taken so long to develop, despite the overall trends towards automation and productivity. For example, the distincti
| CREATE EXTENSION IF NOT EXISTS "unaccent" | |
| CREATE OR REPLACE FUNCTION slugify("value" TEXT) | |
| RETURNS TEXT AS $$ | |
| -- removes accents (diacritic signs) from a given string -- | |
| WITH "unaccented" AS ( | |
| SELECT unaccent("value") AS "value" | |
| ), | |
| -- lowercases the string | |
| "lowercase" AS ( | 
| #/bin/bash | |
| sudo mkdir /Volumes/ESP && sudo mount -t msdos /dev/disk0s1 /Volumes/ESP && sudo bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/efi/refind/refind_x64.efi --shortform && sudo diskutil unmount /Volumes/ESP && rm -rf /Volumes/ESP | 
I recently discovered mpd and found it to be a nice little program. There is a dearth of nice-looking OSX clients, though (besides terminal clients).
Using the hs.socket extension (in master, but not yet in the latest official release), I've created a Hammerspoon frontend that speaks the mpd protocol. With what I have so far, it's already much faster and easier to use than iTunes. I'll link the code on the Hammerspoon wiki once everything is finalized, but an in-progress version is available here.
Using hs.menubar, I've created a series of menubar items to assist with controlling playback. Hovering over the play/pause icon shows the current track.