Skip to content

Instantly share code, notes, and snippets.

View chirag04's full-sized avatar
🚢

Chirag Jain chirag04

🚢
View GitHub Profile
@chirag04
chirag04 / express-busboy.js
Created December 12, 2013 14:43
express-busboy.js
var BusBoy = require('busboy'),
fs = require('fs'),
path = require('path');
var RE_MIME = /^(?:multipart\/.+)|(?:application\/x-www-form-urlencoded)$/i;
// options will have limit and uploadDir.
exports = module.exports = function(options){
return function multipart(req, res, next) {
NSArray *splashXibViews = [[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil];
UIView *splash = [splashXibViews objectAtIndex:0];
splash.frame = rootView.frame;
rootView.loadingView = splash;
rootView.loadingViewFadeDelay = 0.25;
rootView.loadingViewFadeDuration = 0.3;
#import "RCTTextField.h"
@interface RCTTextField (ToolTipMenu)
- (void)tappedMenuItem:(NSString *)text;
@end
import React from 'react';
import ReactNative from 'react-native';
const { View, LayoutAnimation, Keyboard } = ReactNative;
class KeyboardSpacer extends React.Component {
constructor(props) {
super(props);
this.state = {
import SwipeableListView from 'SwipeableListView'
class SwipeableListView extends React.Component {
constructor(props) {
super(props);
this.ds = SwipeableListView.getNewDataSource();
}
render() {
const data = { s1: [ {id: 1, name: 'a'}, {id: 2, name: 'b'}];
@chirag04
chirag04 / flip.js
Last active December 17, 2017 03:45
Flip Animation.
var ViewReactClass = React.createClass({
getInitialState: function() {
return {
panX: new Animated.Value(0),
panY: new Animated.Value(0),
};
},
_animateOpacity: function() {
LayoutAnimation.easeInEaseOut();
@chirag04
chirag04 / algo repo
Last active December 17, 2017 03:45
algo repo
http://www.cs.sunysb.edu/~algorith/
@chirag04
chirag04 / Install.md
Last active March 29, 2019 03:49
compile rocksdb as backend for asyncstorage

Credits

All credit to @sahrens for sharing fb's internal implementation.

Setup

  • clone rocksdb from https://github.com/facebook/rocksdb.

  • edit MakeFile inside rocksdb. Search for Platform-specific compilation around line 1122. Make th next few lines to look like this:

ifeq ($(PLATFORM), IOS)
# For iOS, create universal object files to be used on both the simulator and
import React from 'react';
import ReactNative from 'react-native';
const {
Keyboard,
TextInput,
ScrollView,
findNodeHandle,
} = ReactNative;