Skip to content

Instantly share code, notes, and snippets.

View jasonm23's full-sized avatar

Jason Milkins jasonm23

View GitHub Profile
@jasonm23
jasonm23 / text-property-api.org
Last active August 31, 2022 10:08 — forked from Fuco1/text-property-api-org
Text property api for emacs

All these operations are very natural for buffer objects as well as strings, which leads me to the conclusion we should provide two flavours for each function, for buffers and for strings. The way emacs does it is by specifying an object argument. I find this suboptimal, but it is also possible solution (and would reduce the number of functions in half). Note that there are also different indexing conventions, see the Question below.

All functions come in buffer and string flavours. The “current position” is called point in buffer versions and offset in string

ogit --- other git

On Unix-es use a function to wrap git

Usage: ogit "path/to/repo/" [git options & sub commands]

ogit() {
  _PATH=$1
 shift
@jasonm23
jasonm23 / order-substring-matches.el
Created August 11, 2022 08:08
Order a list of substring matches from s.el's s-matched-positions-all
(defun order-substring-matches (raw-substring-matches)
"Order a set of RAW-SUBSTRING-MATCHES.
Ordered substrings can then be used to perform replacements
on the original source string.
The list is sorted last to first, so that string replacements
don't invalidate replacements using subsequent substring indexes.
Raw substring matches are in the form:

Bewell Ergonomic Standing Desk

I struggled for a while to get my Bewell Ergonomic standing desk to remember it's height presets. Somehow I accidentally got them to work (in a fugue state?). I then promoptly forgot how I got it to work.

Assuming you recieved the same manual that I did, all you learned from it was how to assemble the desk, nothing about the controller.

TBH I now feel very dunb for not working this out sooner, but here's how.

A Quick look at this thing

@jasonm23
jasonm23 / How to set overscan on MacOS Displays when the slider is missing.md
Last active March 12, 2023 08:47
How to set overscan on MacOS Displays when the slider is missing

How to set overscan on MacOS Displays when the slider is missing?

Screenshot 2022-06-03 at 12 21 03

When I connect a monitor or TV to my Mac. Usually I have an overscan slider in the Display Preferences. However sometimes, it's not there. Ironically, this always seems to happen when the screen needs overscan adjustment.

Thankfully it's not impossible to fix the issue.

I haven't found much useful information on this, the difficulty level is quite high, we will need to use the terminal. Open spotlight and type Terminal, press enter and you'll get an imposing Terminal window, with a flashing cursor and not much else. We'll come back to that in a moment or two.

//
// FakeKeyEvents.swift
// CutBox
//
// Created by Jason Milkins on 26/3/18.
// Copyright © 2019-2020 ocodo. All rights reserved.
//
import Foundation
import Carbon
@jasonm23
jasonm23 / Pad Fixer.md
Last active May 16, 2020 18:39
SysEx for Behringer Motör 49 - Drum Pads - Aligned to C1..D#2 (Pads 17-32 repeat C1..D#2)

Pad Fixer.syx file can be sent to a Behringer Motör 49 (and perhaps to other size models too?)

It will set the 8 drum pads to be lined up with C1 .. D#2

Use a SysEx librarian e.g. https://www.snoize.com/SysExLibrarian/docs.html on Mac.

@jasonm23
jasonm23 / clean-code.md
Last active February 13, 2019 00:05
Baseline of software engineering 101.

Programming is the art of telling another human what one wants the computer to do. — Donald Knuth

As Robert C. Martin stated in his book Clean Code: A Handbook of Agile Software Craftsmanship,

“Clean code is code that has been taken care of. Someone has taken the time to keep it simple and orderly. They have paid appropriate attention to details. They have cared.”

Why should you care? What’s wrong with code that just works?

Because software is never written once and finished. It needs to be enhanced, fixed, maintained, usually by more than one person.

@jasonm23
jasonm23 / Alphabet Sentences.txt
Created October 20, 2018 05:28
Alphabet Sentences
Alphabet Sentences