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
bash-3.2$ rm -rf ~/Developer | |
bash-3.2$ open http://www.atmos.org/cinderella/ | |
bash-3.2$ curl https://github.com/atmos/cinderella/raw/master/bootstrap.sh \ | |
> -o - | sh | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
102 1333 102 1333 0 0 3772 0 --:--:-- --:--:-- --:--:-- 33325 | |
Ensuring we have the latest version of cinderella installed | |
A first time install takes about 45 minutes on a modern machine | |
Password: |
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
Input: { | |
"venues": [{ | |
"name": "Grand Central Terminal", | |
"type": "Trending Now" | |
}, | |
{ | |
"name": "New York Penn Station", | |
"type": "Trending Now" | |
}, | |
{ |
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
bash-3.2$ cucumber | |
Feature: Test | |
Background: # features/example.feature:3 | |
Given "sonar.xcodeproj" is loaded in the simulator # iCuke-0.6.3/lib/icuke/cucumber.rb:197 | |
execution expired (Timeout::Error) | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:60:in `launch' | |
features/example.feature:4:in `Given "sonar.xcodeproj" is loaded in the simulator' | |
Scenario: User views the About screen # features/example.feature:6 |
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
// AFIncrementalStore.m | |
// | |
// Copyright (c) 2012 Mattt Thompson (http://mattt.me) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
// AFIncrementalStore.m | |
// | |
// Copyright (c) 2012 Mattt Thompson (http://mattt.me) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
@interface UICollectionViewFlowLayout (InvalidateOnBoundsChange) | |
@end | |
@implementation UICollectionViewFlowLayout (InvalidateOnBoundsChange) | |
- (UICollectionViewLayoutInvalidationContext *)invalidationContextForBoundsChange:(CGRect)newBounds { | |
UICollectionViewLayoutInvalidationContext *context = [super invalidationContextForBoundsChange:newBounds]; | |
CGRect oldBounds = self.collectionView.bounds; | |
CGFloat widthAdjustment = newBounds.size.width - oldBounds.size.width; |
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
case 4: { // Login and logout | |
if ([FBSDKAccessToken currentAccessToken]) { | |
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; | |
[login logOut]; | |
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
// Clear up all the user defaults here. | |
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier]; | |
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain]; | |
[defaults synchronize]; |
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 <Foundation/Foundation.h> | |
#import <stdio.h> | |
@interface MyClass : NSObject | |
@end | |
@implementation MyClass | |
// 1. returns the number of non-zero elements (4) | |
+ (int)numberOfZeroElementsInArray:(NSArray *)array { |
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
-(NSArray<NSString> *)permutationsOfString:(NSString *)s { | |
NSMutableArray<NSString> *res = [NSMutableArray array]; | |
if (s.length == 1) { | |
[res addObject:s]; | |
} else if (s.length > 1) { | |
int lastIndex = s.length - 1; | |
String last = s.substring(lastIndex); | |
String rest = s.substring(0, lastIndex); | |
res = merge(permutation(rest), last); | |
} |
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
// MARK: - Significant location change montioring logic | |
// Called at launch of application if permission is already granted | |
func startMonitoringSignificantLocationChanges() { | |
locationManager.startMonitoringSignificantLocationChanges() | |
} | |
// Called by location manager if there is a significant location change | |
func locationManager(_ manager: CLLocationManager, | |
didUpdateLocations locations: [CLLocation]) { |
OlderNewer