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
puts 'step 1' |
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 'Benchmark' | |
def balanced_delimiters?(text) | |
openers = [] | |
matchers = { | |
')' => '(', | |
']' => '[', | |
'}' => '{' | |
} | |
text.chars.each do |char| |
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
function applyToElements(selector, callback, context){ | |
var elements = document.querySelectorAll(selector); | |
for(var i=0; i < elements.length; i++){ | |
callback.call(context, elements[i]); | |
} | |
} | |
function addPropertyToElements(selector, property, value){ | |
applyToElements(selector, function(el){ | |
el[property] = value; |
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
var images = [ | |
'http://www.placekitten.com/300/300', | |
'http://www.placekitten.com/300/301', | |
'http://www.placekitten.com/300/302', | |
'http://www.placekitten.com/300/303', | |
'http://www.placekitten.com/300/304', | |
'http://www.placekitten.com/300/305', | |
'http://www.placekitten.com/300/306', | |
'http://www.placekitten.com/300/307', | |
'http://www.placekitten.com/300/308', |
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
// | |
// ReactNativeViewObjC.m | |
// | |
#import "ReactNativeViewObjC.h" | |
#import "RCTRootView.h" | |
@implementation ReactNativeViewObjC | |
-(void) initializeReactView { |
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
// | |
// ReactNativeViewObjC.h | |
// | |
#import <UIKit/UIKit.h> | |
@interface ReactNativeViewObjC : UIView | |
@property NSMutableDictionary *data; | |
- (void) initializeReactView; |
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
// | |
// ReactNativeViewSwift.swift | |
// | |
import UIKit | |
class ReactNativeViewSwift: UIView { | |
var data: [String: AnyObject]? |
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
// | |
// ReactNativeObjCViewController.h | |
// | |
#import <UIKit/UIKit.h> | |
@interface ReactNativeObjCViewController : UIViewController | |
@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
// | |
// ReactNativeObjCViewController.m | |
// | |
#import "ReactNativeObjCViewController.h" | |
#import "ReactNativeViewObjC.h" | |
@interface ReactNativeObjCViewController () | |
@property (weak, nonatomic) IBOutlet ReactNativeViewObjC *reactViewWrapper; |
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
// | |
// ReactNativeSwiftViewController.swift | |
// | |
import UIKit | |
class ReactNativeSwiftViewController: UIViewController { | |
@IBOutlet weak var reactViewWrapper: ReactNativeViewSwift! |
OlderNewer