View apple-dev.zsh
# cd to the folder containing an Xcode project dragged from an Xcode window's proxy icon. If no file is provided, cd to the folder containing the current Xcode project
function xc
if [[ `osascript -e 'tell app "System Events" to count processes whose name is "Xcode"'` == 1 ]]; then
if [[ $xcodeIsRunning == false ]]; then
echo "Xcode is not open. I don’t know what you want from me."
function copySafariVersion
local safariVersion=$(defaults read /Applications/ CFBundleShortVersionString)
local safariBuild=$(defaults read /Applications/ CFBundleVersion)
local macOSVersion=$(sw_vers -productVersion)
local macOSBuild=$(sw_vers -buildVersion)
local fullString="Safari ${safariVersion} (${safariBuild}) on macOS ${macOSVersion} (${macOSBuild})"
echo "Copied \"$fullString\""
echo -n $fullString | pbcopy
View NS Prefix Finder.txt
The MIT License (MIT)
Copyright (c) 2016 Zev Eisenberg
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
View map float range.swift
import QuartzCore
extension CGFloat {
func map(from from: ClosedInterval<CGFloat>, to: ClosedInterval<CGFloat>) -> CGFloat {
let result = ((self - from.start) / (from.end - from.start)) * (to.end - to.start) + to.start
return result
extension Double {
View traits.m
static UIFont *versionOfFontWithSymbolicTraits(UIFont *font, UIFontDescriptorSymbolicTraits symbolicTraits)
UIFontDescriptor *descriptor = font.fontDescriptor;
UIFontDescriptor *descriptorToUse = [descriptor fontDescriptorWithSymbolicTraits:symbolicTraits];
UIFont *newFont = [UIFont fontWithDescriptor:descriptorToUse size:font.pointSize];
return newFont;
View PrintAllCharacters.swift
import Foundation
func describeCharsInRange(range: Range<Int>) -> String {
return {
let swiftCharacter = Character(UnicodeScalar($0))
let string = String(swiftCharacter)
let hexString = NSString(format: "0x%.6X", $0) as String
// Optional in theory, but in this case it always returns a value
let name = string.stringByApplyingTransform(NSStringTransformToUnicodeName, reverse: false)!
View iOS 9 system font properties.json
"CTFeatureTypeIdentifier" : 0,
"CTFeatureTypeName" : "All Typographic Features",
"CTFeatureTypeNameID" : -100,
"CTFeatureTypeSelectors" : [
"CTFeatureSelectorDefault" : true,
"CTFeatureSelectorName" : "On",
"CTFeatureSelectorNameID" : -101,
View gist:d95cde83055f6c707050
function gh
local remoteURL=`git remote -v | grep fetch | awk -F ' ' '{print $2}'`
if [[ ! -z $remoteURL ]]; then
local isGitHubURL=`echo $remoteURL | grep -i github\.com`
if [[ ! -z $isGitHubURL ]]; then
local regex=".*github\.com[:/](.*)/(.*)\.git"
if [[ $remoteURL =~ $regex ]]; then
local owner=$match[1]
local repoName=$match[2]
View Ad Blocker

Safari tests run on a Mac mini late 2012, 2.6 GHz Core i7, 16 GB RAM. Didn't bother to reboot or disable these other extensions, so the test is less than scientific:

  • Fireballed
  • ExifExt
  • TinEye
  • Instapaper
  • Smile
  • 1Password (beta)

If you visit any of these URLs, there is a text field where you can paste any other of these URLs to see a comparison report