start new:
tmux
start new with session name:
tmux new -s myname
import { SafeAreaProvider } from 'react-native-safe-area-context'; | |
import * as AuthSession from 'expo-auth-session'; | |
import { RefreshTokenRequestConfig, TokenResponse, TokenResponseConfig } from 'expo-auth-session'; | |
import jwtDecode from 'jwt-decode'; | |
import { useEffect, useState } from 'react'; | |
import { Alert, Platform, Text, TouchableOpacity } from 'react-native'; | |
import { useAsyncStorage } from '@react-native-async-storage/async-storage'; | |
import * as React from 'react' | |
import * as WebBrowser from 'expo-web-browser'; |
# Nerd Fonts for your IDE | |
# https://www.nerdfonts.com/font-downloads | |
brew tap homebrew/cask-fonts && brew install --cask font-3270-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-fira-mono-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-go-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-lgc-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-monofur-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-overpass-nerd-font |
const paymentService = (context, event) => | |
new Promise((resolve, reject) => { | |
// TODO: change this, it's MOCK | |
setTimeout(() => { | |
if (context.plan === 'annual') { | |
return reject('something went wrong'); | |
} | |
return resolve(); |
import React from 'react'; | |
import Router, { NextRouter } from 'next/router'; | |
// Save the scroll position for the given url | |
function saveScrollPosition( | |
url: string, | |
element: HTMLElement, | |
savePosition: (url: string, pos: number) => void | |
) { |
export const APP_LIST = { | |
"whatsapp": {pkgName: "com.whatsapp", urlScheme: "whatsapp", urlParams: "app"}, // fa | |
"facebook": {pkgName: "com.facebook.katana", urlScheme: "fb", urlParams: "requests"}, // fa: facebook-official | |
"facebook messenger": {pkgName: "com.facebook.orca", urlScheme: "fb-messenger", urlParams: "user-thread/{user-id}"}, // fa: facebook | |
"skype": {pkgName: "com.skype.raider", urlScheme: "skype", urlParams: "echo123?call"}, // fa | |
"wechat": {pkgName: "com.tencent.mm", urlScheme: "weixin", urlParams: "dl/chat"}, // fa | |
"snapchat": {pkgName: "com.snapchat.android", urlScheme: "snapchat", urlParams: "?u=foo"}, // fa | |
"twitter": {pkgName: "com.twitter.android", urlScheme: "twitter", urlParams: "messages"}, // fa | |
"youtube": {pkgName: "com.google.android.youtube", urlScheme: "youtube", urlParams: "watch?v=dQw4w9WgXcQ"}, // fa | |
"netflix": {pkgName: "com.netflix.mediaclient", urlScheme: "nflx", urlParams: ""}, |
export const toCamel = (value: string): string => ( | |
value.replace(/([-_][a-z])/ig, ($1) => $1.toUpperCase() | |
.replace("-", "") | |
.replace("_", "")) | |
); |
import React, { useState, useRef, useContext, useCallback } from 'react'; | |
import { Dimensions, View, Animated } from 'react-native'; | |
import { TabView } from 'react-native-tab-view'; | |
import { TabScreen } from './Tab'; | |
import { CustomTabBar } from './TabBar'; | |
import { ThemeContext } from 'react-native-elements'; | |
import { useHeaderHeight } from '@react-navigation/stack'; | |
const AnimatedHeader = ({ style, content }) => { | |
return <Animated.View style={style}>{content}</Animated.View>; | |
}; |
const months = [ | |
{ | |
long: 'January', | |
short: 'Jan', | |
}, | |
{ | |
long: 'February', | |
short: 'Feb', | |
}, |
package main | |
import ( | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
) | |
// Adapted from https://elithrar.github.io/article/generating-secure-random-numbers-crypto-rand/ |