Skip to content

Instantly share code, notes, and snippets.

View kolinkrewinkel's full-sized avatar

Kolin Krewinkel kolinkrewinkel

View GitHub Profile
@alanzeino
alanzeino / lldb-debugging.md
Last active May 29, 2024 03:18
LLDB debugging with examples

LLDB Debugging Cheat Sheet

Commands

LLDB Commands

LLDB comes with a great set of commands for powerful debugging.

help

Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help for more information on a command. Type help to get help for a specific option in a command too.

@jaredsinclair
jaredsinclair / gist:fa72f0917c6a147b3c54
Last active August 29, 2015 14:22
Rough-n-dirty implementation of the unusual horizontal paging used by Twitter.app's inline promoted app cards.
typedef NS_ENUM(NSInteger, BLVScrollDirection) {
// These are by the content offset,
// not by the direction your finger moves.
BLVScrollDirection_RightToLeft,
BLVScrollDirection_LeftToRight
};
@interface BLVNonStandardPagingCalculation : NSObject
@property (nonatomic, assign) NSInteger centeredCardIndex; // Defaults to NSNotFound
@genadyo
genadyo / gist:295a5e8f0d743f57137f
Created November 27, 2014 17:21
app_store_app_data.json
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",
@indragiek
indragiek / LTClientBrowser.h
Last active August 29, 2015 14:01
ReactiveCocoa-based wrapper around NSNetServiceBrowser
//
// LTClientBrowser.h
// LayerTreeServer
//
// Created by Indragie Karunaratne on 2014-05-21.
// Copyright (c) 2014 Indragie Karunaratne. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <LayerTreeKit/LayerTreeKit.h>
@jordanekay
jordanekay / gist:8855193
Created February 7, 2014 00:15
Debug -[UIScrollView setContentOffset:animated:] by changing duration
NSTimeInterval duration = 3.0;
SEL selector = @selector(_setContentOffsetAnimationDuration:);
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[scrollView methodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:scrollView];
[invocation setArgument:&duration atIndex:2];
[invocation invoke];
[scrollView setContentOffset:contentOffset animated:YES]
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@cdl
cdl / colorjs.js
Last active December 30, 2015 16:09
// colorjs.js
// @description An implementation of how I did the color changing background
// on my site. Essentially, I'm using the HSLA color space because
// it makes it really easy to control the general lightness of a
// color and maintain it throughout a bunch of hues. For instance:
// take a look at http://cl.ly/SrT1. Notice how all the colors
// have the same contrast? That's because all that's changed between
// them is the hue values. That's what we're replicating here.
//
// @requirements jQuery –– http://jquery.com/
@mattt
mattt / alfred-wwdc.url
Last active September 25, 2018 10:01
Alfred ASCIIwwdc Web Search
alfred://customsearch/Search%20WWDC%20Sessions/wwdc/utf8/noplus/http://asciiwwdc.com/search?q={query}
@jordanekay
jordanekay / gist:5703459
Last active December 18, 2015 01:19
Naturally sorting a list of titles in Cocoa
#import <Foundation/Foundation.h>
@implementation NSString (JEKNormalization)
- (NSString *)jek_normalizedString
{
__block NSString *normalizedString = self;
[self enumerateLinguisticTagsInRange:NSMakeRange(0, self.length) scheme:NSLinguisticTagSchemeLexicalClass options:~NSLinguisticTaggerOmitWords orthography:nil usingBlock:^(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop) {
if (tag == NSLinguisticTagDeterminer && tokenRange.location == 0) {
normalizedString = [self substringFromIndex:tokenRange.length + 1];
@JaviSoto
JaviSoto / gist:5703432
Created June 4, 2013 03:46
Natural String Sorting
@implementation NSString (JSRemoveIrrelevantTags)
- (NSString *)js_stringByRemovingIrrelevantTags
{
NSMutableString *filteredString = [NSMutableString string];
NSSet *filteredLinguisticTags = [NSSet setWithArray:@[NSLinguisticTagDeterminer, NSLinguisticTagPreposition]];
[self enumerateLinguisticTagsInRange:NSMakeRange(0, self.length)
scheme:NSLinguisticTagSchemeLexicalClass