Skip to content

Instantly share code, notes, and snippets.

View nevyn's full-sized avatar

Nevyn Bengtsson nevyn

View GitHub Profile
- (BOOL)canBecomeFirstResponder
{
return NO;
}
- (BOOL)becomeFirstResponder
{
return NO;
}
func taskize<P1, P2, R1 : AnyObject> (
asyncFunc: (
p1: P1,
p2: P2,
callback: (
r1: R1,
err: NSError?
) -> Void
) -> Void
) -> (p1: P1, p2: P2) -> SPTask
- (void)_displayPendingReviews
{
[[[[[NSFileManager defaultManager]
contentsOfDirectoryAtURL:GFSessionGroupsRoot()
includingPropertiesForKeys:nil
options:NSDirectoryEnumerationSkipsHiddenFiles
error:NULL
] gf_map:^id(NSURL *url) {
return [GFSessionGroup loadFromFileAtURL:url];
}] gf_filter:^BOOL(GFSessionGroup *group) {
@nevyn
nevyn / foo.m
Last active August 29, 2015 14:04
#import <Foundation/Foundation.h>
@interface Foo : NSObject
@property id what;
@end
@implementation Foo
- (BOOL)doingItWrong {
return _what;
}
Jul 21 16:08:34 Moir5 YouTube[3104] <Warning>: <Google> ACTConversionIDReporter: already sent successful ping.
Jul 21 16:08:34 Moir5 YouTube[3104] <Warning>: <Google> ACTRemarketingReporterPrivate: sending ping: http://www.googleadservices.com/pagead/conversion/1001680686/?appversion=2.7.1.11281&bundleid=com.google.ios.youtube&data.screen_name=iOS_YT_App_Open_V2300&label=ZV6UCLLByQYQrt7R3QM&lat=0&muid=M5beL002O1vB-IwDsFAOag&osversion=7.1.2&remarketing_only=1&sdkversion=ct-sdk-i-v3.0.1&timestamp=1405951714.215512.
Jul 21 16:08:34 Moir5 YouTube[3104] <Warning>: <Google> ping successful.
@nevyn
nevyn / GFClock.h
Created July 10, 2014 11:33
Don't use [NSDate timeIntervalFromReferenceDate] if you're working with deltas or timing or anything that isn't directly date related. Use absolute, monotonically increasing time instead. Using mach time is easy but slightly inconvenient; here's a very simple NSDate-like class you can use in your code.
#import <Foundation/Foundation.h>
@interface GFClock : NSObject
+ (instancetype)sharedClock;
// since device boot or something. Monotonically increasing, unaffected by date and time settings
- (NSTimeInterval)absoluteTime;
@end
@nevyn
nevyn / parentprocess.m
Created May 29, 2014 17:20
Prints the name of all the parent processes of this process.
#import <Foundation/Foundation.h>
#import <sys/sysctl.h>
#import <sys/proc_info.h>
#import <libproc.h>
// http://www.objectpark.net/en/parentpid.html
pid_t OPParentIDForProcessID(pid_t pid)
{
struct kinfo_proc info;
size_t length = sizeof(struct kinfo_proc);
### Keybase proof
I hereby claim:
* I am nevyn on github.
* I am nevyn (https://keybase.io/nevyn) on keybase.
* I have a public key whose fingerprint is 4746 A6E5 B607 8617 C3FD 7F18 635F 66E7 2215 2A28
To claim this, I am signing this object:
@nevyn
nevyn / CONTRIBUTING.md
Created April 17, 2014 09:12
some cocoapods docs I wrote until I noticed that http://guides.cocoapods.org/contributing/dev-environment.html already exists

Working with the CocoaPods code base

In case you're unusued to working with Ruby projects or the used build tools, this section explains some work flows that will help you work with the CocoaPods code base.

CocoaPods uses Bundler to manage its dependencies. After checking out the CocoaPods repository, run rake bootstrap (which runs bundler install and git submodule update --init --recursive) to install everything you need to run and work on CocoaPods.

Working on CocoaPods dependencies or subprojects

CocoaPods is split into three: This main project which builds a complete tool, CocoaPodsCore which contains the data model and file parsers, and Xcodeproj which modifies and creates Xcode project and workspace files. For some changes, you are likely to need to make changes to either of those, in addition to the main project. You can tell Bundler that you want to use your local checkout of either of these projects instead of the system-wide installed version when you run the main project's "pod" tool

0.0370 enter Lookback Recording
0.0760 enter Status Bar Notification
0.0820 exit App Settings
0.7280 enter HostVC
0.7280 enter
0.7280 enter Data V C
0.7280 enter
0.7290 enter Data V C
0.7290 enter
0.7290 enter Data V C