This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tell system when Xcode utilities live: | |
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer | |
# Set "opendiff" as the default mergetool globally: | |
git config --global merge.tool opendiff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clang -fobjc-arc -framework Foundation runtime-class.m | |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@interface Person : NSObject | |
- (id)initWithFirstName: (NSString *)firstName lastName: (NSString *)lastName age: (NSUInteger)age; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation MyNavBar | |
- (NSArray*) subviews { | |
NSArray *subviews = [super subviews]; | |
if(_animationDisabled) [self removeAllAnimationsInViews:subviews]; | |
return subviews; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void -[UIPopoverPresentationController dimmingViewWasTapped:](void * self, void * _cmd, void * arg2) { | |
esi = self; | |
edi = @selector(delegate); | |
if ([esi delegate] != 0x0) { | |
eax = [esi delegate]; | |
var_10 = @selector(popoverPresentationControllerShouldDismissPopover:); | |
eax = [eax respondsToSelector:@selector(popoverPresentationControllerShouldDismissPopover:)]; | |
if (LOBYTE(eax) != 0x0) { | |
eax = [esi presented]; | |
if (LOBYTE(eax) != 0x0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UIPopoverPresentationController - (void)dimmingViewWasTapped:(id) | |
void __cdecl -[UIPopoverPresentationController dimmingViewWasTapped:](struct UIPopoverPresentationController *self, SEL a2, id a3) | |
{ | |
void *v3; // eax@2 | |
void *v4; // eax@5 | |
void *v5; // eax@6 | |
void *v6; // eax@7 | |
void *v7; // eax@8 | |
if ( !objc_msgSend(self, selRef_delegate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/C/A/eigen [master] » lldb -p (pgrep '^Xcode$') | |
(lldb) process attach --pid 34726 | |
Process 34726 stopped | |
Executable module set to "/Applications/Xcode-Beta.app/Contents/MacOS/Xcode". | |
Architecture set to: x86_64-apple-macosx. | |
(lldb) po [[NSApplication sharedApplication] windows] | |
<__NSArrayM 0x7fe18be755d0>( | |
<IDEWorkspaceWindow: 0x7fe18045ba40>, | |
<_NSFullScreenUnbufferedWindow: 0x7fe1841b18d0>, | |
<_NSFullScreenTransitionOverlayWindow: 0x7fe1841b3770>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIImage { | |
func imageWithInsets(insetDimen: CGFloat) -> UIImage { | |
return imageWithInset(UIEdgeInsets(top: insetDimen, left: insetDimen, bottom: insetDimen, right: insetDimen)) | |
} | |
func imageWithInset(insets: UIEdgeInsets) -> UIImage { | |
UIGraphicsBeginImageContextWithOptions( | |
CGSizeMake(self.size.width + insets.left + insets.right, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let styles: [UIFont.TextStyle] = [ | |
// iOS 17 | |
.extraLargeTitle, .extraLargeTitle2, | |
// iOS 11 | |
.largeTitle, | |
// iOS 9 | |
.title1, .title2, .title3, .callout, | |
// iOS 7 | |
.headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ZMapTable.swift | |
// | |
// Copyright (c) 2016 Kaz Yoshikawa. Released under MIT License. | |
protocol ZMapTableProtocol: CustomStringConvertible { | |
associatedtype K: AnyObject | |
associatedtype V: AnyObject | |
var mapTable: NSMapTable { get } |
OlderNewer