Skip to content

Instantly share code, notes, and snippets.

View huzaifaaak's full-sized avatar
🎯
Focusing

Huzaifa Khan huzaifaaak

🎯
Focusing
View GitHub Profile
@abdulmuneer22
abdulmuneer22 / gist:41e3dd4b1284a158e9b73b79537b7fff
Created May 26, 2017 06:43
Dynamic Tab View - React Native
import React, { Component } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { TabViewAnimated, TabBar } from 'react-native-tab-view';
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 20,
},
tabbar: {

⚠️ this is now stupidly out of date

Computers

  • 13" Macbook Pro 3.3 GHz i7 (late 2016)
  • Microsoft Surface Book (2016)

Peripherals

@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active March 13, 2024 10:59
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@johnmarinelli
johnmarinelli / app.js
Last active August 17, 2021 19:25
Cavy + React Navigation (TabNavigator)
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)} .../>
}
}
@axemclion
axemclion / JSIObject.cpp
Last active October 4, 2023 19:36
React Native JSI Example
// 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.
@mcousillas6
mcousillas6 / gestureExamples.js
Last active August 9, 2023 07:38
react-native-gesture-handler + react-native-reanimate example
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';
@jmoz
jmoz / rsi.py
Created September 27, 2019 07:41
RSI calculation to match Tradingview
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.
@edvinasbartkus
edvinasbartkus / .github-workflows-main.yml
Created November 16, 2019 10:06
Github Action for React Native Detox
name: Detox
on: [push]
jobs:
build:
runs-on: macOS-latest
timeout-minutes: 15
env:
@edvinasbartkus
edvinasbartkus / android.yml
Created November 20, 2019 14:45
Running Detox tests for Android on Github Actions Workflow
name: Android
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
import React, { useCallback, useEffect, useState } from 'react'
import {
StyleSheet,
View,
Text,
TouchableOpacity,
Button,
Image,
} from 'react-native'