Skip to content

Instantly share code, notes, and snippets.

View jasonm23's full-sized avatar

Jason Milkins jasonm23

View GitHub Profile
@jasonm23
jasonm23 / Alphabet Sentences.txt
Created October 20, 2018 05:28
Alphabet Sentences
Alphabet Sentences
@jasonm23
jasonm23 / Cocoa-macOS-UI-Testing.md
Last active May 30, 2018 04:37
User interface tesing in macOS

UI Testing in Cocoa on macOS

Many times we are encouraged to write unit-tests, and decouple our UI from logic.

Do this, without a doubt, do it.

UI Testing should always be considered a second or third line of defence, to ensure that high level end-to-end integration is all a-ok.

@jasonm23
jasonm23 / sample .json
Last active May 22, 2018 23:58 — forked from jonfuller/status.json
Transmission RPC
{"arguments":{"torrents":[{"id":5,"name":"60.Minutes.S50E37.1080p.WEB.x264-CookieMonster[rarbg]","percentDone":0.4061},{"id":6,"name":"Elementary.S06E04.1080p.HDTV.X264-DIMENSION[rarbg]","percentDone":0.1815},{"id":7,"name":"Stephen.Colbert.2018.05.21.Zachary.Quinto.1080p.WEB.x264-TBS[rarbg]","percentDone":0.1827}]},"result":"success"}
@jasonm23
jasonm23 / Monitoring-XCode-Progress-xcodebuild.md
Last active April 5, 2023 07:45
Monitoring Progress of xcodebuild

Monitoring Progress of xcodebuild

While you can not update XCode's progress bar via an external process, you can generate a progress indicator of some sort in the MacOS menu bar using status items.

For example there's an OpenSource project called BitBar which can be used to create a status item menu using any scripting language (via #! / shebang.)

@jasonm23
jasonm23 / JSContext+subscript.swift
Last active May 14, 2018 08:38
JSContext subscript access for Swift (works like Objective-C JSContext subscript)
extension JSContext {
subscript(_ get: String) -> JSValue! {
get {
return self.objectForKeyedSubscript(get)
}
set { fatalError("get: cannot be used to set") }
}
subscript(_ set: String) -> Any! {
set {
@jasonm23
jasonm23 / getRowViewGeneric.swift
Last active May 10, 2018 11:50
Generic function to get any class of NSView for a NSTableView
import Cocoa
// Use this as a helper function in your table view delegate.
func getRowView<T: NSView>(_ tableView: NSTableView) -> T {
let identifier = NSUserInterfaceItemIdentifier(
rawValue: "\(T.self)")
var dequeuedRowView: T? = tableView.makeView(
withIdentifier: identifier, owner: self
//
// NSScreen+currentScreenForMouseLocation.swift
// CutBox
//
import Cocoa
extension NSScreen {
static func currentScreenForMouseLocation() -> NSScreen? {
let mouseLocation = NSEvent.mouseLocation
@jasonm23
jasonm23 / .CutBox_BitBar.md
Last active May 15, 2018 10:26
bitbar config

CutBox - BitBar

CutBox developer bitbar

@jasonm23
jasonm23 / ec
Last active November 29, 2018 01:22
shell function for Mac to open file(s) in emacs via Emacsclient or start a new Emacs app.
ec() {
emacsclient -n $@ 2> /dev/null
if [[ $? == 1 ]]; then
open -a Emacs.app -- $@
fi
}