Skip to content

Instantly share code, notes, and snippets.

Zev Eisenberg ZevEisenberg

Block or report user

Report or block ZevEisenberg

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
ZevEisenberg / RxSignpost.swift
Created Jun 24, 2019
Use os_signpost for performance logging of transformations in RxSwift
View RxSignpost.swift
import os.signpost
import RxSwift
extension ObservableType {
/// Projects each element of an observable sequence into a new form.
/// Also uses os_signpost to log the duration of transformation.
/// Useful for performance debugging.
/// - Parameters:
ZevEisenberg / License
Last active Mar 2, 2019
Test lots of values without lots of boilerplate
View License
Copyright 2019 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:
The above copyright notice and this permission notice shall be included in all
ZevEisenberg / .lldbinit
Created Sep 12, 2018 — forked from woolsweater/.lldbinit
Break on unsatisfiable constraints and send to wtfautolayout
View .lldbinit
command script import ~/.lldbscripts/
ZevEisenberg / guard.swift
Created Jul 31, 2018
Example Guard indentation
View guard.swift
let foo: Int? = nil
let bar: Int? = nil
let baz: Int? = nil
func x() {
let foo = foo,
let bar = bar,
let baz = baz
else { return }
View SectionedArray.swift
struct SectionedArray<GroupKey, Item> where GroupKey: Comparable & Hashable {
struct Section {
let key: GroupKey
var items: [Item]
var sections: [Section]
var count: Int {
ZevEisenberg / Find Siteswap Loops.swift
Created Dec 4, 2017
Find how long it takes for an async siteswap to loop
View Find Siteswap Loops.swift
// main.swift
// Swapper
// Created by Zev Eisenberg on 12/4/17.
// Copyright © 2017 Zev Eisenberg. All rights reserved.
// Code ported from
// It finds how many beats you would have to juggle an async siteswap pattern before
ZevEisenberg / Dictionary+Utilities.swift
Created Nov 29, 2017
Convert a dictionary’s keys from NSAttributedStringKey to String
View Dictionary+Utilities.swift
extension Dictionary where Key == NSAttributedStringKey {
var withStringKeys: [String: Value] {
return reduce(into: [:], {
$0[$1.key.rawValue] = $1.value
ZevEisenberg / Files changed during macOS Security Update 2017-001 installation.txt
Created Nov 29, 2017
Files changed during macOS Security Update 2017-001 installation
View Files changed during macOS Security Update 2017-001 installation.txt
11:55:09 AM ↗️ 0x15900 /Users/zev/Library/Preferences/
11:55:09 AM ↘️ 0x10800 /Users/zev/Library/Preferences/
11:55:09 AM ↗️ 0x15900 /Users/zev/Library/Preferences/com.tristan.FSMonitor.plist.cR5WRLP
11:55:09 AM ↘️ 0x10800 /Users/zev/Library/Preferences/com.tristan.FSMonitor.plist
11:55:09 AM 🆕 0x14100 /Users/zev/Library/Preferences/ByHost/
11:55:10 AM ↗️ 0x15900 /Users/zev/Library/Preferences/ByHost/
11:55:10 AM ↘️ 0x10800 /Users/zev/Library/Preferences/ByHost/
11:55:10 AM 🛠 0x18000 /private/var/db/diagnostics/Persist/0000000000000283.tracev3
11:55:10 AM 🆕 0x14100 /Users/zev/Library/Preferences/com.tristan.FSMonitor.plist.tbghtkX
11:55:10 AM ❌ 0x11300 /Users/zev/Library/Caches/at.obdev.LaunchBar/IndexingProgressLog.plist
ZevEisenberg / apple-dev.zsh
Created Jul 22, 2017
Utility functions for doing iOS and Mac development
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."
You can’t perform that action at this time.