Skip to content

Instantly share code, notes, and snippets.

Jonathon Mah jmah

Block or report user

Report or block jmah

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jmah / DictEnumTests.m
Created Apr 19, 2015
NSDictionary Enumeration Benchmark
View DictEnumTests.m
// DictEnumTests.m
#import <Cocoa/Cocoa.h>
#import <XCTest/XCTest.h>
@interface DictEnumTests : XCTestCase
View gist:950fb8172b8cd7f857b7
- (ListNode *)next {
if (_next) {
ListNode *nextCopy = [[ListNode alloc] init]; =; =;
return nextCopy;
} else {
return nil;
jmah / tail-recursion.m
Last active Aug 29, 2015
Tail Recursion Experiments in Objective-C
View tail-recursion.m
// Created by Jonathon Mah on 2014-05-24.
// Released into the public domain.
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface ListNode : NSObject
jmah /
Created Mar 28, 2014
Rebase Keybase

Keybase proof

I hereby claim:

  • I am jmah on github.
  • I am jmah ( on keybase.
  • I have a public key whose fingerprint is CDE3 A069 8566 DC89 85B1 FE93 2CB3 42F6 6E8A 5FB9

To claim this, I am signing this object:

jmah / loan.applescript
Created Oct 10, 2012
Creating Loans with Delicious Library 2
View loan.applescript
tell front document of application "Delicious Library 2"
set f to first friend
set m to first item of (get selected media)
set due to (current date) + 2 * weeks
make new loan with properties {due date:due, borrower:f, medium:m}
end tell
View View Book on Open Library.scpt
-- Menu Path: "Item"
tell front document of application "Delicious Library 2"
repeat with theItem in (get selected media)
if class of theItem is book and isbn of theItem is not missing value then
set theISBN to isbn of theItem
tell application "Safari"
open location ("" & theISBN)
end tell
jmah / Ratings.scpt
Created May 17, 2012
Basic example AppleScript for Delicious Library
View Ratings.scpt
tell front document of application "Delicious Library 2"
set howMany to count of (every medium whose rating 4)
end tell
tell application "TextEdit"
make new document with properties ¬
{text:"There are " & howMany & " items in Delicious Library rated at least 4 stars."}
end tell
jmah / Random Unwatched Movie.applescript
Created May 16, 2012
Suggest an unwatched movie from Delicious Library
View Random Unwatched Movie.applescript
tell front document of application "Delicious Library 2"
-- Choose a random unwatched movie
set unwatchedItems to every movie whose experienced is false
if (count of unwatchedItems) is 0 then
display dialog "You don't have any unwatched movies." buttons {"OK"} default button "OK"
end if
set randomIndex to random number from 1 to (count of unwatchedItems)
set candidateItem to item randomIndex of unwatchedItems
You can’t perform that action at this time.