Skip to content

Instantly share code, notes, and snippets.

sending gifs


sending gifs
View GitHub Profile
View useWebSockets.tsx
import {useEffect, useRef, useState} from 'react';
import io from '';
type Props = {
userId: number;
enabled: boolean;
onConnected?: () => void;
type Message = {
View useInfiniteQuery.tsx
import React, {useState} from 'react';
import {
} from 'react-native';
jonasgroendahl / PickerModal.tsx
Created Aug 10, 2020
Picker modal directly from the project
View PickerModal.tsx
import React, {useState, useEffect} from 'react';
import {Modal, View, StyleSheet} from 'react-native';
import {Picker} from '@react-native-community/picker';
import Typography from './Typography';
import IconButton from './IconButton';
import Icon from './Icon';
import {useTranslation} from '../context/Language';
import ThemeColors from '../utils/Colors';
type Props = {
View calendar.tsx
import React, {useState} from 'react';
import {View, TouchableOpacity} from 'react-native';
import {Agenda} from 'react-native-calendars';
import {Card, Avatar} from 'react-native-paper';
import Typography from '../components/Typography';
const timeToString = (time) => {
const date = new Date(time);
return date.toISOString().split('T')[0];
View Languageprovider.tsx
import React, {useState, useEffect, useContext} from 'react';
import en from '../lang/en.json';
import zh from '../lang/zh.json';
import * as RNLocalize from 'react-native-localize';
import App from '../App';
type LanguageContextType = {
hello: string;
View index.js
const fetch = require("node-fetch");
const qs = require("querystring");
const nodemailer = require("nodemailer");
const cron = require("node-cron");
const EMAIL = "";
const PASSWORD = "";
const searchWord = "canon eos rp";
jonasgroendahl / Profile.tsx
Last active Dec 28, 2020
Picker Modal Gist - React native
View Profile.tsx
import React, {useState} from 'react';
import {View, StyleSheet, ScrollView, Image} from 'react-native';
import Container from '../components/Container';
import Typography from '../components/Typography';
import Paper from '../components/Paper';
import Icon from '../components/Icon';
import TextField from '../components/TextField';
import Spacer from '../components/Spacer';
import Button from '../components/Button';
import Center from '../components/Center';
View useTracking.ts
import {useEffect, useState} from 'react';
import {Alert} from 'react-native';
import BackgroundGeolocation from '@mauron85/react-native-background-geolocation';
import {defaultLocation} from '../utils/vars';
import {getDistanceFromLatLonInKm} from '../utils/getDistance';
const useTracking = (isActive: boolean) => {
const [location, setLocation] = useState(defaultLocation);
const [history, setHistory] = useState<any>([]);
const [distance, setDistance] = useState<number>(0);
View fetch - get marketplace listings
const fetch = require("node-fetch");
const getData = async () => {
try {
const response = await fetch("", {
headers: {
"content-type": "application/x-www-form-urlencoded"
View code
const el = document.querySelector(".item");
let isResizing = false;
el.addEventListener("mousedown", mousedown);
function mousedown(e) {
window.addEventListener("mousemove", mousemove);
window.addEventListener("mouseup", mouseup);