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 sensate | |
import Sensate, { Event, Message } from 'sensate' | |
// Import wanted gateways | |
import SlackGateway from 'sensate-gateway-slack' | |
// Logging | |
const log = () => console.log.apply(console, arguments) | |
// Create a new sensate instance that connects to slack |
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
let (background, primary, secondary) = image.analyzeColors() | |
switch background { | |
case primaryText.isContrasting(background): | |
self.titleLabel.textColor = primaryText | |
case secondaryText.isContrasting(background): | |
self.titleLabel.textColor = secondaryText |
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
/// | |
/// All targets have the same base URL | |
/// | |
let BaseURL = NSURL(string: "http://example.com/v1")! | |
/// | |
/// First target handles user-related api endpoints | |
/// | |
/// .Authentication needs to: | |
/// 1. Make the request to the path with the given credentials |
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
// Brawl Tests | |
import * as Brawl from "./brawl" | |
// Create a new match | |
let match = new Brawl.Match(); | |
// Enter some players | |
let friendly = new Brawl.Player("Friendly", match); | |
let opposing = new Brawl.Player("Opposing", match); |
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
// Grab API instance | |
let API = APIClient.instance | |
// Attempt to authenticate with username and password | |
let Authentication = API.authenticate(username, password: password) | |
Authentication.onSuccess { user in | |
println("Logged in as \(user.userName!)!") | |
// Load user images after a successful sign-in | |
let UserImages = API.imagesForUserId(user.id!, nextToken: nil) |
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
reduce( | |
emailAddressField.textDynamic(), | |
passwordField.textDynamic(), | |
confirmPasswordField.textDynamic(), | |
false) { email, password, confirm in | |
return email != "" && password != "" && confirm != "" && password == confirm | |
} ->> signupButton |
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> | |
@interface IOSTools : NSObject | |
- (NSString *)getCountry; | |
@end |
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
// Splitter view recognizer should only begin if we're truly touching something inside the splitter view | |
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer | |
{ | |
if (gestureRecognizer == _splitterPanRecognizer) { | |
CGPoint location = [gestureRecognizer locationInView:self.view]; | |
BOOL didHitView = NO; | |
NSArray *hitTestViews = @[_splitterView]; | |
hitTestViews = [hitTestViews arrayByAddingObjectsFromArray:_splitterView.subviews]; |
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
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSArray *contents = [fileManager contentsOfDirectoryAtPath:directoryPath error:NULL]; | |
NSEnumerator *e = [contents objectEnumerator]; | |
NSString *filename; | |
while ((filename = [e nextObject])) { | |
NSString *filePath = [directoryPath stringByAppendingPathComponent:filename]; | |
if ([[filePath pathExtension] isEqualToString:@"jpg"]) { | |
// jpegitz |
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
// | |
// AccountsViewController.h | |
// | |
// Created by Nico Hämäläinen on 28/03/14. | |
// | |
#import <UIKit/UIKit.h> | |
@interface AccountsViewController : UIViewController |
NewerOlder