This file contains 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, { useCallback } from 'react' | |
export interface FormProps | |
extends React.DetailedHTMLProps< | |
React.FormHTMLAttributes<HTMLFormElement>, | |
HTMLFormElement | |
> {} | |
export const Form: React.FC<FormProps> = ({ onSubmit, ...rest }) => { | |
const handleSubmit = useCallback( | |
(e: React.FormEvent<HTMLFormElement>) => { |
This file contains 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 { useState, useCallback } from 'react' | |
export function useTextField( | |
initialValue?: string | |
): [ | |
string | undefined, | |
(e: React.ChangeEvent<HTMLInputElement>) => void, | |
React.Dispatch<React.SetStateAction<string | undefined>> | |
] { | |
const [val, setVal] = useState(initialValue) |
This file contains 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
{ | |
"React FC": { | |
"prefix": "rfc", | |
"body": [ | |
"import React from 'react'", | |
"export interface ${TM_FILENAME_BASE}Props {", | |
"}", | |
"", | |
"export const ${TM_FILENAME_BASE}: React.FC<${TM_FILENAME_BASE}Props> = () => {", | |
"}" |
This file contains 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
for i in *.wav; do ffmpeg -i $i `basename -s '.wav' $i`.mp3; done |
This file contains 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 const trimBase64TypePrefix = (b64str: string) => { | |
return b64str.replace(/data:.+;base64,/, '') | |
} |
This file contains 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, { useState, useEffect } from 'react' | |
import PhotoLibraryIcon from '@material-ui/icons/PhotoLibrary' | |
import Button from '@material-ui/core/Button' | |
import { makeStyles } from '@material-ui/core/styles' | |
import PlaceholderImage from './PlaceholderImage' | |
const useStyles = makeStyles(theme => ({ | |
textContainer: { | |
paddingTop: 0 |
This file contains 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 Button from '@material-ui/core/Button' | |
export interface BasicFileInputProps { | |
label: string | |
accept: string | |
value: File | null | |
onChange: (file: File | null) => void | |
} | |
const BasicFileInput: React.FC<BasicFileInputProps> = ({ |
This file contains 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, { useState, useEffect } from 'react' | |
import QRCode from 'qrcode' | |
export interface QRCodeImageProps { | |
value: string | |
} | |
const QRCodeImage: React.FC< | |
QRCodeImageProps & React.ImgHTMLAttributes<HTMLImageElement> | |
> = ({ value, ...rest }) => { | |
const [dataUrl, setDataUrl] = useState('') |
This file contains 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 { makeStyles } from '@material-ui/core/styles' | |
import ImageIcon from '@material-ui/icons/Image' | |
interface PlaceHolderImageProps { | |
width: number | |
height: number | |
} |
This file contains 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
package test_helper | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
) | |
type BearerAuthClient struct { | |
token string |