Skip to content

Instantly share code, notes, and snippets.

View efstathiosntonas's full-sized avatar

Stathis Ntonas efstathiosntonas

View GitHub Profile
@efstathiosntonas
efstathiosntonas / App.tsx
Last active December 19, 2022 19:57
React Native card swiper like iOS iMessage multiple images swiper
import React, {FC} from 'react';
import {Dimensions, StyleSheet, View} from 'react-native';
import {
Gesture,
GestureDetector,
GestureHandlerRootView,
} from 'react-native-gesture-handler';
import Animated, {
Easing,
interpolate,
@efstathiosntonas
efstathiosntonas / react_native_pods.rb
Created April 7, 2021 12:52
patched react_native_pods.rb, fixes directory not found in rn 0.64.0 ios builds
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
def use_react_native! (options={})
# The prefix to react-native
prefix = options[:path] ||= "../node_modules/react-native"
# Include Fabric dependencies
@efstathiosntonas
efstathiosntonas / focus.js
Created February 5, 2021 08:16
Force TextInput to focus when using react-navigation
const [isFocused, setIsFocued] = React.useState(true)
const setFocus = React.useCallback(() => {
setIsFocued(true)
}, [])
const setBlur = React.useCallback(() => {
setIsFocued(false)
}, [])
@efstathiosntonas
efstathiosntonas / gist:ce4d8cea1936a65c99ef49bf75717c08
Created October 6, 2020 03:52
System and custom message react native gifted chat
import {
GiftedChat,
SystemMessage,
// ...all other imports
} from "react-native-gifted-chat
<GiftedChat
// ...all other stuff
@efstathiosntonas
efstathiosntonas / ReactNativeOneSignalNotificationsHandlerAsyncStorage.js
Last active September 19, 2019 10:09
OneSignal React Native Notifications Handler and AsyncStorage
import AsyncStorage from '@react-native-community/async-storage';
import {Navigation} from 'react-native-navigation';
import {uniqBy} from 'lodash';
// using uuid/v4 to generate unique keys for each notification for FlatList etc.
import uuidv4 from 'uuid/v4';
// AsyncStorage.clear();
export const handleNotifications = async (notification, condition, ref) => {
console.log('COMING FROM ', ref);
@efstathiosntonas
efstathiosntonas / greek_capital_cities_coordinates.json
Created September 4, 2019 14:05
Greek Capital Cities Coordinates JSON
[
{"name": "Αττικής", "location": [38.08333 ,23.5]},
{"name": "'Αγιος Νικόλαος Αθηνών'", "location": [38.005852, 23.729193]},
{"name": "Άγιος Ελευθέριος", "location": [38.021036, 23.729219]},
{"name": "Αθήνα κέντρο", "location": [37.980812, 23.724287]},
{"name": "Αμπελόκηποι", "location": [37.988734, 23.763039]},
{"name": "Αττική Αθηνών", "location": [37.997651, 23.721319]},
{"name": "Γκάζι", "location": [37.978538, 23.712526]},
{"name": "Γουδί", "location": [37.985828, 23.767172]},
{"name": "Ελαιώνας", "location": [38.007859, 23.667688]},
@efstathiosntonas
efstathiosntonas / index.js
Created January 11, 2018 14:02
Facebook Ads every X posts in React Native Flatlist
import React, {Component} from 'react';
import {ActivityIndicator, AsyncStorage, Dimensions, FlatList, LayoutAnimation, StyleSheet, Text, TouchableHighlight, TouchableOpacity, View, Alert, Platform} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import {Card, CardImage, CardTitle} from 'react-native-material-cards';
import ActionButton from 'react-native-circular-action-menu';
import ImagePicker from 'react-native-image-crop-picker';
import {MaterialIndicator} from 'react-native-indicators';
import Storage from 'react-native-storage';
import {EventRegister} from 'react-native-event-listeners';
import shortid from 'shortid';