Skip to content

Instantly share code, notes, and snippets.

@jemise111
jemise111 / step 1.rb
Last active August 29, 2015 14:02
Test file 1
puts 'step 1'
require 'Benchmark'
def balanced_delimiters?(text)
openers = []
matchers = {
')' => '(',
']' => '[',
'}' => '{'
}
text.chars.each do |char|
@jemise111
jemise111 / jqliteHelper.js
Created January 13, 2015 18:57
jqlite helper
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;
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',
//
// ReactNativeViewObjC.m
//
#import "ReactNativeViewObjC.h"
#import "RCTRootView.h"
@implementation ReactNativeViewObjC
-(void) initializeReactView {
//
// ReactNativeViewObjC.h
//
#import <UIKit/UIKit.h>
@interface ReactNativeViewObjC : UIView
@property NSMutableDictionary *data;
- (void) initializeReactView;
//
// ReactNativeViewSwift.swift
//
import UIKit
class ReactNativeViewSwift: UIView {
var data: [String: AnyObject]?
//
// ReactNativeObjCViewController.h
//
#import <UIKit/UIKit.h>
@interface ReactNativeObjCViewController : UIViewController
@end
//
// ReactNativeObjCViewController.m
//
#import "ReactNativeObjCViewController.h"
#import "ReactNativeViewObjC.h"
@interface ReactNativeObjCViewController ()
@property (weak, nonatomic) IBOutlet ReactNativeViewObjC *reactViewWrapper;
//
// ReactNativeSwiftViewController.swift
//
import UIKit
class ReactNativeSwiftViewController: UIViewController {
@IBOutlet weak var reactViewWrapper: ReactNativeViewSwift!