Skip to content

Instantly share code, notes, and snippets.

Avatar
🚢

Chirag Jain chirag04

🚢
View GitHub Profile
View rnsplash.m
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;
View KeyboardAvoidingScrollView.js
import React from 'react';
import ReactNative from 'react-native';
const {
Keyboard,
TextInput,
ScrollView,
findNodeHandle,
} = ReactNative;
View keyboard spacer
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 = {
View SwipeableListView
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'}];
View A react-native android Facebook login setup.md
View react-native-open-issues-by-author
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 Mar 29, 2019
compile rocksdb as backend for asyncstorage
View Install.md

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
View test in-app load product failure.
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
NSLog(@"Failed to load list of products.%@", error);
}
@chirag04
chirag04 / flip.js
Last active Dec 17, 2017
Flip Animation.
View flip.js
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
Core changes for tooltip with text idea
View RCTText.h
/**
* 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>