Skip to content

Instantly share code, notes, and snippets.

View enestatli's full-sized avatar
💭
I may be slow to respond.

enestatli

💭
I may be slow to respond.
View GitHub Profile
@aymanosman
aymanosman / App.nested-stack.js
Created February 10, 2020 11:41
react-navigation-stack ModalPresentationIOS with nested stacks
import * as React from 'react';
import {View, Text, Button} from 'react-native';
import {NavigationNativeContainer} from '@react-navigation/native';
import {createStackNavigator, TransitionPresets} from '@react-navigation/stack';
function HomeScreen({navigation}) {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text>Home Screen</Text>
<Button
@derekstavis
derekstavis / FastList.tsx
Last active August 7, 2025 17:52 — forked from vishnevskiy/FastList.js
Discord's FastList, but in TypeScript
import { forEachObjIndexed } from "ramda";
import * as React from "react";
import {
Animated,
ScrollView,
View,
ViewStyle,
LayoutChangeEvent,
NativeScrollEvent,
} from "react-native";
@nartc
nartc / BarcodeMask.tsx
Last active August 3, 2023 08:44
ReactNative Camera Barcode Mask (from react-native-barcode-mask) rewritten using Hooks and Reanimated
import React, { FC, memo } from 'react';
import { LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';
import Animated, { Easing } from 'react-native-reanimated';
const { Value, Clock, block, cond, set, startClock, timing, eq } = Animated;
type DimensionUnit = string | number;
type EdgePosition = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
interface Props {
@mudge
mudge / use-debounce.js
Last active August 10, 2024 20:58
A custom React Hook for a debounced click handler with a given callback and delay.
/*
* Inspired by Dan Abramov's "Making setInterval Declarative with React Hooks",
* this is a custom hook for debouncing a callback (e.g. for click handlers) such
* that a callback will not be fired until some delay has passed since the last click.
* The callback will automatically be updated with the latest props and state on every
* render meaning that users don't need to worry about stale information being used.
*
* See https://overreacted.io/making-setinterval-declarative-with-react-hooks/ for the
* original inspiration.
*/
# 1. Unlock keychain for auto-signing package *
security unlock-keychain -p <your-admin-password> ~/Library/Keychains/login.keychain
# 2. Build JS-bundle to Xcode project
react-native bundle --entry-file='index.js' --bundle-output='./ios/<your-app-name>/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
# 3. Building an archive
xcodebuild -project ./ios/<your-project-name>.xcodeproj -scheme '<your-scheme-name>' -derivedDataPath ./ios/build -archivePath ./ios/archive/<your-app-name>.xcarchive archive | xcpretty
# 4. Export the archive to an *.ipa package
@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.
@jamesreggio
jamesreggio / react-forwardref-simple-example.js
Last active February 6, 2025 02:06
Simple example usage of React.forwardRef()
// EmailInput wraps an HTML `input` and adds some app-specific styling.
const EmailInput = React.forwardRef((props, ref) => (
<input ref={ref} {...props} type="email" className="AppEmailInput" />
));
class App extends Component {
emailRef = React.createRef();
render() {
return (
@xuan9
xuan9 / getiOSDistName.sh
Last active May 6, 2021 06:50
react native packaging scripts
export shortVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ios/myapp/Info.plist );
export bundleVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleVersion" ios/myapp/Info.plist );
export distName=MyApp-$shortVersion-$bundleVersion
@jordanmkoncz
jordanmkoncz / .react-navigation iOS 11 Navigation Bar with Large Title
Last active March 10, 2025 15:57
react-navigation iOS 11 Navigation Bar with Large Title
#
@alanbosco
alanbosco / convert.py
Created October 4, 2017 18:57
Convert .CSV to VCF Python
# -*- coding: utf-8 -*-
#python 3.x
import csv
import sys
#convert a "comma separated values" file to vcf contact cards. I used this to convert a list of student
#names and phone numbers into a vcf and save the trouble of adding one by one through phone
#USAGE: