Skip to content

Instantly share code, notes, and snippets.

View dilipsuthar97's full-sized avatar
:octocat:
Enjoying tech world

Dilip Suthar dilipsuthar97

:octocat:
Enjoying tech world
View GitHub Profile
module.exports = {
bracketSpacing: true,
jsxBracketSameLine: true,
singleQuote: true,
jsxSingleQuote: true,
trailingComma: 'all',
usesTabs: true,
tabWidth: 4,
printWidth: 100,
};
@dilipsuthar97
dilipsuthar97 / Tools.js
Last active January 27, 2022 12:21
Global helper functions
import { Constants } from '../CommonConfig';
import moment from 'moment';
/**
* Return random number between inclusive and exclusive
* @param {Number} length - exclusive length for randome number
* @param {Boolean} countOne - add plus 1 count
*/
const getRandomNumber = (exclusiveLength = 1, countOne = false) => {
if (countOne) {
import * as React from 'react';
import { View, Text, Image, StyleSheet, Animated } from 'react-native';
import { Matrics, Colors, Icons, Fonts } from '../CommonConfig';
import { Tools } from '../Helpers';
import Bounceable from './Bounceable';
/**
* 'reactionFlag' value is same as in DB
* it's useful during sending data with API request
*/
// --------------- LIBRARIES ---------------
import React from 'react';
import { View, StyleSheet, Image } from 'react-native';
import FastImage from 'react-native-fast-image';
// --------------- ASSETS ---------------
// --------------- COMPONENT ---------------
const MyFastImage = ({
style,
placeholder,
import React from 'react';
import { Animated } from 'react-native';
import {
TapGestureHandler,
LongPressGestureHandler,
State,
} from 'react-native-gesture-handler';
export default ({
children,
// --------------- LIBRARIES ---------------
import * as React from 'react';
import { View, TouchableOpacity, StyleSheet, Platform } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
const {
event,
Value,
import React from 'react';
import {
StyleSheet,
Text,
View,
StatusBar,
Dimensions,
Image,
Animated,
findNodeHandle,

Git Config Guid

Installation

  1. Download & Install git first

Config

  1. git config —global user.email "<your git email>"
  2. git config —global user.name "<your git username OR name>"

Create new repository

@dilipsuthar97
dilipsuthar97 / tsconfig.json
Last active May 11, 2020 08:41
ReactNative typescript configuration json file
{
"compilerOptions": {
/* Basic Options */
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
"lib": ["ES2017", "ES7", "ES6", "DOM"],
"declaration": true,
"outDir": "lib", /* Add tthis only for library project otherwise comment this line */
@dilipsuthar97
dilipsuthar97 / MyLibraryPackage.java
Created May 11, 2020 08:31
Android Native Module wrapper for ReactNative -MyLibraryPackage.java
package com.reactlibrary;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;