A tiny zero-dependency compression middleware for polka (& express!) with native Brotli support.
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 { | |
useDialogState, | |
Dialog, | |
DialogDisclosure, | |
DialogBackdrop, | |
} from "reakit/Dialog" | |
import styles from "./Layout.module.css" | |
function Layout({ children }) { | |
const dialog = useDialogState({ animated: true }) |
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
#!/usr/bin/env bash | |
magick convert $1 -resize 16x16 16.png | |
magick convert $1 -resize 32x32 32.png | |
magick convert $1 -resize 48x48 48.png | |
magick convert 16.png 32.png 48.png favicon.ico |
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 MetaTrader5 as mt5 | |
import pymt5adapter | |
from pymt5adapter.order import Order | |
from pymt5adapter.symbol import Symbol | |
class MySymbol(Symbol): | |
def pips(self, amount): | |
return amount * 10 * self.point |
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 firebase from 'firebase/app'; | |
import 'firebase/messaging'; | |
import { useEffect, useRef } from 'react'; | |
import config from '../config'; | |
import firebaseConfig from './firebaseConfig'; | |
import { PushTokenAddMutation } from './__generated__/PushTokenAddMutation.graphql'; | |
import { PushTokenAdd, USER_PUSHENDPOINT_TYPE } from './PushTokenAddMutation'; |
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
- name: Restore yarn workspaces | |
id: yarn-cache | |
uses: actions/cache@master | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' |
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 { useField, FieldHookConfig, FieldInputProps, FieldMetaProps, FieldHelperProps } from 'formik'; | |
import { useDebouncedCallback } from 'use-debounce'; | |
const DEBOUNCE_DELAY = 300; | |
export function useFastField<Val = any>( | |
propsOrFieldName: string | FieldHookConfig<Val>, | |
): [FieldInputProps<Val>, FieldMetaProps<Val>, FieldHelperProps<Val>] { | |
const [field, meta, helpers] = useField<Val>(propsOrFieldName); |
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
(() => { | |
let count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('button.is-following') || []; | |
} | |
async function unfollowAll() { | |
const buttons = getAllButtons(); |
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, { useRef, useState } from 'react'; | |
import { Typography } from '@material-ui/core'; | |
import TextField from '@material-ui/core/TextField'; | |
import CircularProgress from '@material-ui/core/CircularProgress'; | |
import Autocomplete, { | |
AutocompleteChangeDetails, | |
AutocompleteChangeReason, | |
AutocompleteProps | |
} from '@material-ui/lab/Autocomplete'; |