I hereby claim:
- I am dtheng on github.
- I am dtheng (https://keybase.io/dtheng) on keybase.
- I have a public key whose fingerprint is 1AEA B94C 0B7D 38A2 E253 3050 2AF2 03F3 E4B9 E225
To claim this, I am signing this object:
{ | |
"workbench.colorTheme": "Default Light+", | |
"workbench.colorCustomizations": { | |
"activityBar.foreground": "#0055ff", | |
"activityBar.background": "#FAFAFA", | |
"activityBar.border": "#E7E9EB", | |
"activityBar.dropBackground": "#E7E9EB", | |
"activityBarBadge.background": "#1a32af", | |
"activityBarBadge.foreground": "#FAFAFA", | |
"statusBar.background": "#FAFAFA", |
I hereby claim:
To claim this, I am signing this object:
import UIKit | |
extension UIColor { | |
static func random() -> UIColor { | |
switch (arc4random_uniform(15)) { | |
case 0: | |
return UIColor.blackColor() | |
case 1: | |
return UIColor.darkGrayColor() |
import UIKit | |
extension CGRect { | |
func fit(width : CGFloat, height : CGFloat, fill : Bool) -> CGRect { | |
let isWidthGreater = width > height | |
let ratio = isWidthGreater ? width / height : height / width | |
let w = isWidthGreater ? (fill ? self.width * ratio : self.width) : (fill ? self.width : self.width / ratio) | |
let h = !isWidthGreater ? (fill ? self.height * ratio : self.height) : (fill ? self.height : self.height / ratio) | |
return CGRect(x: isWidthGreater ? (fill ? 0 - ((w - self.width) / 2) : 0) : (fill ? 0 : (self.width - w) / 2), |
#!/usr/bin/env python | |
import hashlib | |
import hmac | |
import time | |
import json | |
import urllib2 | |
import datetime | |
# Q. Do you have A Websocket API? | |
# A. Yes, and we strongly recommend you to use it. Please, check our JavaScript websocket implementation for our WebSocket API here: |
[exampleObservable subscribe:[[DTSubscriber alloc] init:^(NSDictionary *profile) { | |
BOOL twentyFive = [profile[@"age"] intValue] == 25; | |
NSLog(@"Is age 25? %@", twentyFive ? @"YES" : @"NO"); | |
} onError:^(NSError *error) { | |
NSLog(@"%@", error); | |
}]]; |
DTObservable *exampleObservable = [[DTObservable alloc] init:^(DTSubscriber *subscriber) { | |
NSDictionary *profile = @{ | |
@"firstName": @"Daniel", | |
@"lastName": @"Thengvall", | |
@"age": @25}; | |
// Lets pretend something cpu intensive happens here | |
[NSThread sleepForTimeInterval:1.f]; |
pod 'DTObservable' | |
#import <DTObservable/DTObservable.h> | |
#import <DTObservable/DTObservable.h> | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
DTObservable *exampleObservable = [[DTObservable alloc] init:^(DTSubscriber *subscriber) { | |
NSDictionary *profile = @{ |