Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Huzaifa Khan huzaifaaak

🎯
Focusing
View GitHub Profile
@mrousavy
mrousavy / MEMOIZE.md
Last active Dec 2, 2021
Memoize!!! 💾 - a react (native) performance guide
View MEMOIZE.md
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 {
StyleSheet,
View,
Text,
TouchableOpacity,
Button,
Image,
} from 'react-native'
@edvinasbartkus
edvinasbartkus / android.yml
Created Nov 20, 2019
Running Detox tests for Android on Github Actions Workflow
View android.yml
name: Android
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
@edvinasbartkus
edvinasbartkus / .github-workflows-main.yml
Created Nov 16, 2019
Github Action for React Native Detox
View .github-workflows-main.yml
name: Detox
on: [push]
jobs:
build:
runs-on: macOS-latest
timeout-minutes: 15
env:
@jmoz
jmoz / rsi.py
Created Sep 27, 2019
RSI calculation to match Tradingview
View rsi.py
import pandas as pd
def rsi(ohlc: pd.DataFrame, period: int = 14) -> pd.Series:
"""See source https://github.com/peerchemist/finta
and fix https://www.tradingview.com/wiki/Talk:Relative_Strength_Index_(RSI)
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
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
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
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
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 => {
View workstation.md