Skip to content

Instantly share code, notes, and snippets.


Zev Eisenberg ZevEisenberg

View GitHub Profile
woolsweater / .lldbinit
Last active Sep 12, 2018
Break on unsatisfiable constraints and send to wtfautolayout
View .lldbinit
command script import ~/.lldbscripts/
AliSoftware / GHDiff-HidePods.js
Last active Feb 13, 2017
Hide Pods/* related files in a GitHub diff page
View GHDiff-HidePods.js
// When you are in the diff page of a GitHub PR
// And want to hide all the Pods/* files in that diff page, use this:
// Paste that in your Web Inspector's console
var nodes = document.evaluate("//div[@class='file-header' and starts-with(@data-path,'Pods/')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );
for(i=0; i<nodes.snapshotLength; ++i) {
nodes.snapshotItem(i).parentNode.hidden = true
// Or even better, create a bookmark with this code for easy quick access:
bomberstudios /
Last active Nov 8, 2019
How to diff your .sketch files in Git

Using sketchtool to diff your .sketch files using text


You need to have SketchTool installed somewhere in your path.


Add this in your ~/.gitconfig file (for some reason, it won't work in a local .gitconfig file):

ZevEisenberg /
Last active Mar 1, 2021
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
View gist:442f7f14ab698b30b94e

The following line omitted the text in bold:

button.enabled = [string length] > 0;

As a result, the string's length, a value of type NSUInteger, or unsigned long on 64-bit, was stuffed into a BOOL, which is actually a typedef for signed char. Comparisons of this frankenbool against NO yield the right result, but only for values below 255. Anything above might truncate and yield an erroneous NO. Comparing against YES, meanwhile, only returns the right result for the value 1. By setting the button's enabled state to an unsigned integer, the code was effectively disabling the button for all strings shorter or longer than one character.

neonichu / update_xcode_plugins
Last active Sep 18, 2019
Update DVTPlugInCompatibilityUUIDs for installed plugins from Xcode 5.1 beta to final
View update_xcode_plugins
#ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2
ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3
function add_compatibility() {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \
raven / Breakpoints_v2.xcbkptlist
Last active Aug 30, 2019
Symbolic breakpoint for dynamically linking libReveal against UIApplicationMain
View Breakpoints_v2.xcbkptlist
<?xml version="1.0" encoding="UTF-8"?>
type = "2"
version = "2.0">
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
shouldBeEnabled = "Yes"
ignoreCount = "0"
stuartjmoore / WPHangingQuoteViewController.m
Last active Nov 9, 2016
Hanging quotes on iOS 7.Basically, we set the UITextView's left inset to the negative width of a double quote, then undo that per line fragment if the line doesn't start with a double quote.And the opposite for an exclusion path lines.
View WPHangingQuoteViewController.m
- (void)loadOrResizeOrSometing {
* After creating the text view or resizing the font, set the quoteWidth and contentInset.
WPTextContainer *textContainer = (WPTextContainer*)paragraphView.textContainer;
textContainer.spaceWidth = [self widthForCharacter:@" "];
textContainer.charWidths = @{
@(8220) : @([self widthForCharacter:@""]),
@(8216) : @([self widthForCharacter:@""]),
@('"') : @([self widthForCharacter:@"\""]),
fabiofl / gist:5873100
Created Jun 27, 2013
Clear Mac OS X's icon cache.
View gist:5873100
sudo find /private/var/folders/ -name -exec rm {} \;
ttscoff / itunesicon.rb
Last active Feb 19, 2021
Retrieve a 512 x 512px icon for an iOS app
View itunesicon.rb
# encoding: utf-8
# Updated 2017-10-25:
# - Defaults to large size (512)
# - If ImageMagick is installed:
# - rounds the corners (copped from @bradjasper,
# - replace original with rounded version, converting to png if necessary
# Retrieve an iOS app icon at the highest available resolution