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
ZevEisenberg / resetAllSimulators.sh
Last active Nov 12, 2019
Reset all iOS simulators with this one weird trick
View resetAllSimulators.sh
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@ZevEisenberg
ZevEisenberg / iOS 9 system font properties.json
Created Aug 13, 2015
Result of calling CTFontCopyFeatures on the system font in iOS 9 beta 5
View iOS 9 system font properties.json
[
{
"CTFeatureTypeIdentifier" : 0,
"CTFeatureTypeName" : "All Typographic Features",
"CTFeatureTypeNameID" : -100,
"CTFeatureTypeSelectors" : [
{
"CTFeatureSelectorDefault" : true,
"CTFeatureSelectorName" : "On",
"CTFeatureSelectorNameID" : -101,
@ZevEisenberg
ZevEisenberg / XCTestCase+Extensions.swift
Last active Oct 4, 2019
Useful additions for common problems with XCTest
View XCTestCase+Extensions.swift
//
// XCTestCase+Unwrapping.swift
// Created by Zev Eisenberg on 6/2/19.
// Feel free to use, share, etc. No need to credit, but a link back to this page would be nice.
//
import XCTest
extension XCTestCase {
@ZevEisenberg
ZevEisenberg / RxSignpost.swift
Last active Sep 13, 2019
Use os_signpost for performance logging of transformations in RxSwift
View RxSignpost.swift
// RxSwift signposts
import os.signpost
import RxSwift
func signpost<T>(log: OSLog, name: StaticString, value: String, _ thing: () throws -> T) rethrows -> T {
let signpostID = OSSignpostID(log: log)
os_signpost(
.begin,
@ZevEisenberg
ZevEisenberg / File_1.json
Created Sep 5, 2019
JSON hosting example
View File_1.json
{
"some key": "some value"
}
View gist:6a0f8326d302733c8819
2015-01-26 18:02:31.223 Invaluable iOS[29323:1139622] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '{objective 0x7ff55b678f30: <251:-343, 250:915> + <250:5.96046e-08>*0x7ff55d81f580.marker{id: 7363} + <250:-2.98023e-08>*0x7ff55db73220.marker{id: 7364} + <250:2>*0x7ff55fa3e030.marker{id: 9313} + <250:2>*0x7ff55fd01060.negError{id: 9018} + <250:-2>*0x7ff55fd01060.posErrorMarker{id: 9017} + <250:-2>*0x7ff55fd018b0.marker{id: 9032}}: internal error. Setting empty vector for variable INVTriColumnPriceView:0x7ff55fe35160.minX{id: 8877}.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001085ddf35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010546cbb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001085dde6d +[NSException raise:format:] + 205
3 Foundation 0x00000001060cf45e -[NSISObjectiveLinearExpression setPriorityVector:forKnownAbsentVariable:] + 76
@ZevEisenberg
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
ZevEisenberg / map float range.swift
Last active Oct 14, 2018
Mapping floating point numbers between two ranges in Swift
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 {
@ZevEisenberg
ZevEisenberg / .lldbinit
Created Sep 12, 2018 — forked from woolsweater/.lldbinit
Break on unsatisfiable constraints and send to wtfautolayout
View .lldbinit
command script import ~/.lldbscripts/break_unsatisfiable.py
@ZevEisenberg
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
})
}
}
You can’t perform that action at this time.