docker rm -f $(docker ps -a -q)
docker volume rm $(docker volume ls -q)
| export LANG=en_US.UTF-8 | |
| export LANGUAGE=en_US.UTF-8 | |
| export LC_ALL=en_US.UTF-8 |
| const reduxSwitchcase = (cases, key) => | |
| key in cases ? cases[key] : state => state; | |
| export default reduxSwitchcase; |
| import { | |
| MongoClientOptions, | |
| MongoClient, | |
| Db, | |
| FilterQuery, | |
| FindOneOptions, | |
| OptionalId, | |
| CollectionInsertOneOptions, | |
| FindOneAndUpdateOption, | |
| UpdateQuery, |
| 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 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); |
| import React from 'react'; | |
| export interface AsyncHandlerProps<T> { | |
| handler: () => Promise<T>; | |
| children(res: { | |
| state: State<T>; | |
| execute: () => Promise<void>; | |
| }): React.ReactNode; | |
| } |
| 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> { |
| 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 |
| 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"); |