Skip to content

Instantly share code, notes, and snippets.

antonjn / DebuggingOverlay.m
Created November 26, 2017 21:56 — forked from ian-mcdowell/DebuggingOverlay.m
UIDebuggingInformationOverlay for iOS 10 & 11
View DebuggingOverlay.m
// Used for swizzling on iOS 11+. UIDebuggingInformationOverlay is a subclass of UIWindow
@implementation UIWindow (DocsUIDebuggingInformationOverlaySwizzler)
- (instancetype)swizzle_basicInit {
return [super init];
// [[UIDebuggingInformationOverlayInvokeGestureHandler mainHandler] _handleActivationGesture:(UIGestureRecognizer *)]
// requires a UIGestureRecognizer, as it checks the state of it. We just fake that here.
- (UIGestureRecognizerState)state {
View example_block_swizzling.m
@implementation UILabel (SwizzlingExamples)
+ (void)load
SwizzleSelectorWithBlock_Begin(self, @selector(initWithFrame:))
^(UILabel *self, CGRect frame) {
if ((self = ((id (*)(id, SEL, CGRect))_imp)(self, _cmd, frame))) {
// ...
return self;
View Solarized (Dark).tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>Solarized (dark)</string>
import lldb
def GetFirstArgumentAsValue(target, frame):
# Note: I assume the PC is at the first instruction of the function, before the stack and registers have been modified.
if target.triple.startswith('x86_64'):
return frame.regs[0].GetChildMemberWithName("rdi")
elif target.triple.startswith('i386'):
espValue = frame.regs[0].GetChildMemberWithName("esp")
address = espValue.GetValueAsUnsigned() + target.addr_size
return espValue.CreateValueFromAddress('arg0', address, target.FindFirstType('id'))
View MJPlaceholderView.h
#import <UIKit/UIKit.h>
// IB_DESIGNABLE means that the view will be
// rendered live in Interface Builder.
@interface MJPlaceholderView : UIView
// IBInspectable means that the property
antonjn /
Created August 16, 2012 22:00 — forked from basecode/
'no-break space' detection plugin for Sublime Text 2
# encoding: utf-8
import sublime, sublime_plugin
class DetectSpecialCharacters(sublime_plugin.EventListener):
def on_load(self, view):
sublime.status_message("detect_special_characters is active")
def on_modified(self, view):
# find no-break space
special_characters = view.find_all(u"\u00A0")