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 lldb | |
import commands | |
def __lldb_init_module (debugger, dict): | |
debugger.HandleCommand('command script add -f LBRShortcut.window_description_command window_description') | |
debugger.HandleCommand('command script add -f LBRShortcut.json_data_command json_data') | |
debugger.HandleCommand('command script add -f LBRShortcut.fire_fault_command fire_fault') | |
def window_description_command(debbuger, command, result, dict): |
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
// | |
// NSFont+SystemFont.h | |
// xScope | |
// | |
// Created by Craig Hockenberry on 4/17/14. | |
// | |
// Thanks to http://nshipster.com/method-swizzling/ | |
#import <Cocoa/Cocoa.h> |
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
// | |
// NSAttributedString+RZExtensions.h | |
// Raizlabs | |
// | |
// Created by Alex Rouse on 12/13/13. | |
// Copyright 2014 Raizlabs and other contributors | |
// http://raizlabs.com/ | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining |
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
#!/bin/sh | |
# | |
# Pre-Commit Hook that checks for Xcode5 format XIB files as they won't be | |
# openable in Xcode4 | |
# Redirect output to stderr. | |
exec 1>&2 | |
xcode5xibs=`find . -name *.xib -exec grep "<document.*type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\"" {} + | sed -e 's/:.*//'` |
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
NSString* string = @"Hello World"; | |
UIFont *font = [UIFont fontWithName:@"Helvetica-BoldOblique" size:21]; | |
CGSize constraint = CGSizeMake(300,NSUIntegerMax); | |
NSDictionary *attributes = @{NSFontAttributeName: font}; | |
CGRect rect = [string boundingRectWithSize:constraint | |
options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) |
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
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
#import <objc/runtime.h> | |
#import <objc/message.h> |
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/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 |
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
static void dispatch_repeated_internal(dispatch_time_t firstPopTime, double intervalInSeconds, dispatch_queue_t queue, void(^work)(BOOL *stop)) | |
{ | |
__block BOOL shouldStop = NO; | |
dispatch_time_t nextPopTime = dispatch_time(firstPopTime, (int64_t)(intervalInSeconds * NSEC_PER_SEC)); | |
dispatch_after(nextPopTime, queue, ^{ | |
work(&shouldStop); | |
if(!shouldStop) | |
{ | |
dispatch_repeated_internal(nextPopTime, intervalInSeconds, queue, work); | |
} |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
// | |
// NSObject+Blocks.h | |
// Filemator | |
// | |
// Created by Zachary Waldowski on 4/12/11. | |
// Copyright 2011 Dizzy Technology. All rights reserved. | |
// | |
@interface NSObject (Blocks) |