Skip to content

Instantly share code, notes, and snippets.

View chirag04's full-sized avatar
🚢

Chirag Jain chirag04

🚢
View GitHub Profile
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 React from 'react';
import ReactNative from 'react-native';
const {
Keyboard,
TextInput,
ScrollView,
findNodeHandle,
} = ReactNative;
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'}];
ide: 72
brentvatne: 20
PhilippKrone: 18
cancan101: 14
yelled3: 13
mkonicek: 11
aleclarson: 10
jaygarcia: 9
satya164: 8
rocman: 8
@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
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
NSLog(@"Failed to load list of products.%@", error);
}
@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 / RCTText.h
Created May 15, 2015 21:27
Core changes for tooltip with text idea
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <UIKit/UIKit.h>