This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export LANG=en_US.UTF-8 | |
export LANGUAGE=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reduxSwitchcase = (cases, key) => | |
key in cases ? cases[key] : state => state; | |
export default reduxSwitchcase; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
MongoClientOptions, | |
MongoClient, | |
Db, | |
FilterQuery, | |
FindOneOptions, | |
OptionalId, | |
CollectionInsertOneOptions, | |
FindOneAndUpdateOption, | |
UpdateQuery, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class CustomError extends Error { | |
code = ''; | |
errors: { [key: string]: string[] } = {}; | |
length = 0; | |
constructor(message: string, code: string) { | |
super(message); | |
this.code = code; | |
} | |
setError = (key: string, message: string) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is a simulation of react-i18n's API | |
import React, { ComponentType } from 'react'; | |
import get from 'lodash/get'; | |
import { Diff } from 'utility-types'; | |
type Labels = { [key: string]: string }; | |
export type WithTranslation = { t: (key: string) => string }; | |
export const t = (labels: Labels) => (key: string): string => get(labels, key, key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export interface AsyncHandlerProps<T> { | |
handler: () => Promise<T>; | |
children(res: { | |
state: State<T>; | |
execute: () => Promise<void>; | |
}): React.ReactNode; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Chart, {ChartDataSets} from 'chart.js'; | |
import styles from './styles'; | |
interface Props { | |
labels: string[]; | |
datasets: ChartDataSets[]; | |
} | |
class Graph extends React.Component<Props> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { View, Text, Dimensions } from "react-native"; | |
import Modal from "react-native-modal"; | |
import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome"; | |
import { TouchableOpacity } from "react-native-gesture-handler"; | |
import { faCheckCircle, faCircle } from "@fortawesome/free-regular-svg-icons"; | |
import styles from "./styles"; | |
const { width } = Dimensions.get("window"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import DatePicker from "react-datepicker"; | |
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | |
import { faQuestionCircle } from "@fortawesome/free-regular-svg-icons"; | |
import "react-datepicker/dist/react-datepicker.css"; | |
import styles from "./styles.module.css"; | |
interface Props<Key> { | |
id: Key; | |
value?: Date | null; |