Skip to content

Instantly share code, notes, and snippets.

@luisobo
luisobo / unused_assets
Created May 26, 2014 19:34
Detect unused assets
#!/bin/bash
all_assets=`find $1 -type f | uniq | grep -v @2x`
for asset in $all_assets; do
name=`basename $asset | cut -d . -f 1`
count=`git grep $name | grep -v project.pbxproj: | wc -l`
echo -e "$count\t$asset"
done
@luisobo
luisobo / gist:ef9568876d83371ac0a2
Last active August 29, 2015 14:00
Disable advertisingIdentifier to avoid AppStore rejection
__attribute__((constructor))
void PIXWhatPartOfAdvertisingTrackingEnabledDidYouNotUnderstand(void) {
if (![[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {
IMP newImplementation = imp_implementationWithBlock(^NSUUID *{
return nil;
});
Method m = class_getInstanceMethod([ASIdentifierManager class], @selector(advertisingIdentifier));
method_setImplementation(m, newImplementation);
}
}
@luisobo
luisobo / gist:9996253
Created April 5, 2014 18:50
keybase.md
### Keybase proof
I hereby claim:
* I am luisobo on github.
* I am luisobo (https://keybase.io/luisobo) on keybase.
* I have a public key whose fingerprint is 92D6 4381 84EB 2104 CB60 52C5 8F6C 0F26 F0A5 160D
To claim this, I am signing this object:
@luisobo
luisobo / gist:8604822
Created January 24, 2014 19:50
ReactiveCocoa: List of most modified files of the project
329 ReactiveCocoaFramework/ReactiveCocoa.xcodeproj/project.pbxproj
217 ReactiveCocoaFramework/ReactiveCocoaTests/RACSignalSpec.m
196 ReactiveCocoaFramework/ReactiveCocoa/RACSignal+Operations.m
117 ReactiveCocoaFramework/ReactiveCocoa/ReactiveCocoa.h
115 ReactiveCocoaFramework/ReactiveCocoa/RACSignal.m
113 ReactiveCocoaFramework/ReactiveCocoa/RACSignal+Operations.h
109 ReactiveCocoaFramework/ReactiveCocoa/RACSequence.m
100 README.md
93 Documentation/DesignGuidelines.md
84 ReactiveCocoaFramework/ReactiveCocoa/RACSubscribable+Operations.m
@luisobo
luisobo / README.md
Created January 9, 2014 21:24
Lazy property

Usage

@interface Foo : NSObject

@property (nonatomic, strong) NSString *foo;

@end

@implementation Foo
@luisobo
luisobo / gist:6620798
Created September 19, 2013 08:52
Xcode 5 IDEWorkspace NSView hierarchy
0x00007f944f5f4b30 [ A LU ] h=-&- v=-&& NSView 0x7f944d03da60 f=(0,0,1400,823) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ A LU ] h=&&& v=-&- DVTTabSwitcher 0x7f944d042280 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ AF LU ] h=-&- v=-&- NSTabView 0x7f944d0425c0 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.01 ms
[ A LU ] h=-&- v=-&- DVTControllerContentView 0x7f944d97ee50 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ AF P LU ] h=--- v=--- DVTSplitView 0x7f944d99afc0 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.01/0.08/0.80 ms
[ H LU ] h=-&- v=-&- DVTReplacementView 0x7f944d9eac40 f=(-260,0,260,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ hA LU ] h=-&- v=-&- DVTControllerContentView 0x7f944d963fa0 f=(0,0,260,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ hA LU ] h=--- v=--- NSView 0x7f944d965280
@luisobo
luisobo / README.md
Last active January 14, 2016 14:19
Hide iOS Simulator when running Unit Tests.

Hide iOS Simulator when running Unit Tests.

Based on this work, that @Dan2552 pointed out.

Instructions:

  1. Clone this gist (git clone https://gist.github.com/6201428.git hide_ios_simulator)
  2. Xcode -> Preferences -> Behavior -> Testing -> Generates output
  3. Run script -> Choose script -> Select hide_simulator
@luisobo
luisobo / first load
Created December 14, 2011 23:25
Factory girl loading factories twice
["/Users/Luis/Documents/Shopkeep/repos/backoffice/test/factories.rb:3:in `<top (required)>'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:174:in `eval'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:174:in `debug_eval'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:82:in `block in execute'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:19:in `run_with_binding'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:81:in `execute'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:275:in `one_cmd'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:261:in `block (2 levels) in process_commands'",
"/Users/Luis/.rvm/gems/ruby-1.9.2-p290/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:2