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 _name = Observable<String>("Hello") | |
var name: ObservableOf<String> { | |
return ObservableOf(self._name) | |
} | |
var scope: NSString? = "Yeehaw" | |
self.name.observe { (oldValue, newValue) -> Void in | |
print("\(oldValue) => \(newValue)") | |
}.scopeTo(scope!) | |
self._name.value = "Payne" |
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
// | |
// AppDelegate.swift | |
// MediaQueryKit | |
// | |
// Created by Robert Payne on 21/05/15. | |
// Copyright (c) 2015 Zwopple Limited. All rights reserved. | |
// | |
import UIKit |
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
@loginViewController { | |
@formView { | |
width == ^ - 32.0 | |
centerX == ^ | |
centerY == ^ + 16.0 | |
bottom <= ^ - 16.0 | |
@emailField { | |
top.left.right == ^ |
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 "RCTBridgeModule.h" | |
#define RCT_EXTERN_MODULE(objc_name, objc_supername) \ | |
RCT_EXTERN_REMAP_MODULE(objc_name, objc_name, objc_supername) | |
#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \ | |
objc_name : objc_supername \ | |
@end \ | |
@interface objc_name (RCTExternModule) <RCTBridgeModule> \ |
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
require "Subprocess" | |
require "tmpdir" | |
# | |
# Currently will only convert a single swift code file into a static library | |
# and cannot include any Objective-C code. | |
# | |
# Usage: generate("/path/to/MyCode.swift", :ios) | |
# | |
def generate(file, platform, dst=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
#import <UIKit/UIKit.h> | |
#import <Masonry/Masonry.h> | |
@interface UIView (MasonryTagging) | |
- (void)prepareConstraintsWithTag:(NSString *)tag block:(void (^)(MASConstraintMaker *make))block; | |
- (void)removePreparedConstraintsWithTag:(NSString *)tag; | |
- (void)installConstraintsWithTag:(NSString *)tag; | |
- (void)installConstraintsWithTag:(NSString *)tag recursive:(BOOL)recursive; | |
- (void)uninstallConstraintsWithTag:(NSString *)tag; |
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
require 'celluloid' | |
require 'celluloid/io' | |
require 'celluloid/redis' | |
class CelluloidRedisClient < ::Redis::Client | |
def initialize(opts={}) | |
@terminated = false | |
super | |
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
require File.expand_path('../websocket_handler.rb', __FILE__) | |
class Server < Reel::Server | |
include Celluloid::Logger | |
def initialize(host = '0.0.0.0', port = (ENV['PORT'] || 5000).to_i) | |
super(host, port, &method(:on_connection)) | |
end | |
def on_connection(connection) |
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
// | |
// DRNBoxBlur.h | |
// LiveBlur | |
// | |
// Created by Robert Payne on 1/10/13. | |
// Copyright (c) 2013 Zwopple Limited. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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 NSManagedObjectArchiver : NSObject | |
/* | |
* Takes a NSManagedObject and converts it to a NSData archive - it traverses all relationships ( including circular ) and archives it | |
*/ | |
+ (NSData *)archivedDataWithRootObject:(NSManagedObject *)pObject; | |
@end |
NewerOlder