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
@woolsweater
woolsweater / .lldbinit
Last active Sep 12, 2018
Break on unsatisfiable constraints and send to wtfautolayout
View .lldbinit
command script import ~/.lldbscripts/break_unsatisfiable.py
@AliSoftware
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
bomberstudios / sketch-diff-in-git.md
Last active Nov 8, 2019
How to diff your .sketch files in Git
View sketch-diff-in-git.md

Using sketchtool to diff your .sketch files using text

Requirements

You need to have SketchTool installed somewhere in your path.

Setup

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

@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
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
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
#!/bin/sh
#ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2
ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3
PLIST_BUDDY=/usr/libexec/PlistBuddy
function add_compatibility() {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \
"$1/Contents/Info.plist"
@raven
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"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
@stuartjmoore
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
fabiofl / gist:5873100
Created Jun 27, 2013
Clear Mac OS X's icon cache.
View gist:5873100
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@ttscoff
ttscoff / itunesicon.rb
Last active May 8, 2019
Retrieve a 512 x 512px icon for an iOS app
View itunesicon.rb
#!/usr/bin/ruby
# encoding: utf-8
#
# Updated 2017-10-25:
# - Defaults to large size (512)
# - If ImageMagick is installed:
# - rounds the corners (copped from @bradjasper, https://github.com/bradjasper/Download-iTunes-Icon/blob/master/itunesicon.rb)
# - replace original with rounded version, converting to png if necessary
#
# Retrieve an iOS app icon at the highest available resolution
You can’t perform that action at this time.