Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ari Braginsky lemonkey

🏠
Working from home
Block or report user

Report or block lemonkey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lemonkey
lemonkey / fix_keyrepeat_rate.sh
Created Mar 17, 2018
macOS: fix keyboard repeat rate
View fix_keyrepeat_rate.sh
#!/bin/bash
# 20180315
# https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
@lemonkey
lemonkey / xcode-user-breakpoints.xml
Created Nov 9, 2017
Xcode User Breakpoints 20171109
View xcode-user-breakpoints.xml
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
@lemonkey
lemonkey / property.m
Created Oct 28, 2016 — forked from quellish/property.m
Managed object property access
View property.m
[[managedObject managedObjectContext] performBlock:^{
NSString *value = [managedObject someValue];
[NSOperationQueue mainQueue] addOperationWithBlock:^{
[[self label] setText:value];
}];
}];
View save.m
[managedObjectContext performBlock:^{
NSError *error = nil;
if (![managedObjectContext save:&error]){
[self handleError:error];
}
}];
View allPeopleInManagedObjectContext.m
- (void) allPeopleInManagedObjectContext:(NSManagedObjectContext *)managedObjectContext withCompletion:(void (^)(NSArray*, NSError*))completion {
[managedObjectContext performBlock:^{
NSError *error = nil;
NSArray *results = nil;
NSFetchRequest *fetchRequest = nil;
NSPredicate *predicate = nil;
NSEntityDescription *entity = nil;
fetchRequest = [[NSFetchRequest alloc] init];
entity = [NSEntityDescription entityForName:@"Person" inManagedObjectContext:context];
@lemonkey
lemonkey / saveManagedObjectContext.m
Created Oct 28, 2016 — forked from quellish/saveManagedObjectContext.m
Recursive save of managed object context
View saveManagedObjectContext.m
- (void) saveManagedObjectContext:(NSManagedObjectContext *)managedObjectContext withCompletion::(void (^)(BOOL, NSError *))completio{
managedObjectContext performBlock:^{
NSError *error = nil;
if (![managedObjectContext save:&error]){
completion(NO, error);
} else {
if ([managedObjectContext parentContext] != nil){
[self saveManagedObjectContext:[managedObjectContext parentContext] withCompletion:completion];
} else {
@lemonkey
lemonkey / waitForBlock.m
Created Oct 28, 2016 — forked from quellish/waitForBlock.m
Pseudo-sample of synchronous use of Core Data performBlock: using dispatch group
View waitForBlock.m
group = dispatch_group_create();
dispatch_group_enter(group);
[context performBlock:^{
result = [context executeFetch:...
dispatch_group_leave(group);
}];
groupResult = dispatch_group_wait(group, DISPATCH_TIME_FOREVER);
@lemonkey
lemonkey / fetchThingsWithCompletion.m
Created Oct 28, 2016 — forked from quellish/fetchThingsWithCompletion.m
Pseudo-sample of a core data fetch with a completion block.
View fetchThingsWithCompletion.m
- (void) fetchThingsWithCompletion:(void (^)(NSArray *, NSError *))completion{
[context performBlock:^{
result = [context executeFetch:...
if (completion != nil){
completion(result, error);
}
}];
}
@lemonkey
lemonkey / gist:cc9d807a7b6ecd0cac33
Created Jan 19, 2016
MH: Adding Swift Support to hAPITracker key milestones
View gist:cc9d807a7b6ecd0cac33
* 001: Upgrade to CocoaPods v0.39 and fix custom post install steps in Podfiles, etc. (Mon 11/16) (Wed 11/18)
* 002: Add use_frameworks! to hAPITracker and SS Podfile and investigate problems (Mon 11/16) (Thu 11/19)
* 003: Upgrade 3rd party dependencies as needed (Wed 11/18) (Thu 11/26)
* 004: Create new blank hAPITrackerFramework using Cocoa Touch Framework Xcode project (Thu 11/19) (Thu 11/19)
* 005: Turn hAPITrackerFramework into a CocoaPod that is used as a local dev pod only (no specs repo) (Thu 11/19) (Thu 11/19)
* 006: Create new blank iOS app that has hAPITrackerFramework as a dependency, with use_frameworks! (Thu 11/19) (Thu 11/19)
* 007: Add a unit test to hAPITrackerFramework and make sure it can run (Thu 11/19) (Thu 11/19)
* 008: Add a unit test to new blank iOS app and make sure it can run (Thu 11/19) (Thu 11/19)
* 009: Add all 3rd party pods to hAPITrackerKit (Fri 11/20) (Thu 11/26)
* 010: Add static libraries and source from libs folder from existing hAPITracker to new framework (TN, Google Ana
@lemonkey
lemonkey / podinstall-after_classes.log
Last active Nov 23, 2015
pod install log for https://github.com/CocoaPods/CocoaPods/issues/4570, after sample classes added to Pod1 and Pod2 Cocoa Touch Frameworks
View podinstall-after_classes.log
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods`: (``)
Using `ARCHS` setting to build architectures of target `Pods-Main`: (``)
Using `ARCHS` setting to build architectures of target `Pods-MainTests`: (``)
Finding Podfile changes
- Pod1
- Pod2
You can’t perform that action at this time.