Skip to content

Instantly share code, notes, and snippets.


Huzaifa Khan huzaifaaak

View GitHub Profile
mrousavy /
Last active Dec 2, 2021
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
View account.jsx
import React, { useCallback, useEffect, useState } from 'react'
import {
} from 'react-native'
edvinasbartkus / android.yml
Created Nov 20, 2019
Running Detox tests for Android on Github Actions Workflow
View android.yml
name: Android
on: [push]
runs-on: macos-latest
- name: Checkout
edvinasbartkus / .github-workflows-main.yml
Created Nov 16, 2019
Github Action for React Native Detox
View .github-workflows-main.yml
name: Detox
on: [push]
runs-on: macOS-latest
timeout-minutes: 15
jmoz /
Created Sep 27, 2019
RSI calculation to match Tradingview
import pandas as pd
def rsi(ohlc: pd.DataFrame, period: int = 14) -> pd.Series:
"""See source
and fix
Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements.
RSI oscillates between zero and 100. Traditionally, and according to Wilder, RSI is considered overbought when above 70 and oversold when below 30.
Signals can also be generated by looking for divergences, failure swings and centerline crossovers.
mcousillas6 / gestureExamples.js
Last active Sep 26, 2021
react-native-gesture-handler + react-native-reanimate example
View gestureExamples.js
import React, { useMemo, useRef } from 'react';
import { View } from 'react-native';
import { node } from 'prop-types';
import { PanGestureHandler, State, PinchGestureHandler } from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
import styles from './styles';
/** styles.js
import { StyleSheet } from 'react-native';
axemclion / JSIObject.cpp
Last active Sep 28, 2021
React Native JSI Example
View JSIObject.cpp
// This sample is a Work in Progress for JSI , and specific functions may change.
#pragma once
#include <string>
#include <unordered_map>
#include <jsi/jsi.h>
// This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to JS.
johnmarinelli / app.js
Last active Aug 17, 2021
Cavy + React Navigation (TabNavigator)
View app.js
import { TabNavigator } from 'react-navigation'
import Ionicons from 'react-native-vector-icons/Ionicons'
import { hook } from 'cavy'
class Icon extends Component {
render() {
const { navigation, generateTestHook, routeName... } = this.props
return <Ionicons ref={generateTestHook(`Navigation.${routeName}`)} onPress={() => navigation.navigate(routeName)} .../>
mkjiau / axios-interceptors-refresh-token.js
Last active Nov 24, 2021
Axios interceptors for token refreshing and more than 2 async requests available
View axios-interceptors-refresh-token.js
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
instance.interceptors.response.use(response => {
return response;
}, error => {