- results: all events
- order: created desc (most recent to oldest)
- result: events that are newer than
evt_id(created at a later time thanevt_id)
| import { useEffect, useRef } from 'react'; | |
| export type OnIntersect = (elt: HTMLElement) => void; | |
| /** | |
| * Hook for running an IntersectionObserver. | |
| * @param onIntersect this is used in the deps of useEffect, you can | |
| * employ useCallback to prevent it from running | |
| * after every render | |
| * @param args |
| from typing import Any, Optional, Union | |
| from decimal import Decimal | |
| class AirtableBadTypeException(Exception): | |
| def __init__(self, val: Any): | |
| self.val = val | |
| super().__init__(f"unexpected type variable type: {type(val)}") | |
| import { DocumentClient } from "aws-sdk/lib/dynamodb/document_client"; | |
| export async function* autoPaginateScan<I extends DocumentClient.AttributeMap>( | |
| docClient: DocumentClient, | |
| params: DocumentClient.ScanInput | |
| ) { | |
| while (true) { | |
| const data = await docClient.scan(params).promise(); | |
| if (data.Items && data.Items.length) { |
| import React from 'react'; | |
| import { useBeforeunload } from 'react-beforeunload'; | |
| import { Prompt } from 'react-router'; | |
| const DEFAULT_MESSAGE = 'You will lose unsaved changes if you leave this page.'; | |
| type BlockUnloadProps = { | |
| when?: boolean; | |
| message?: string; | |
| }; |
| import { useState, Dispatch, SetStateAction } from 'react'; | |
| export const useUpdateState = <S extends object>( | |
| defaultState: S | |
| ): [S, (newState: Partial<S>) => void, Dispatch<SetStateAction<S>>] => { | |
| const [state, setState] = useState(defaultState); | |
| const updateState = (newState: Partial<S>) => | |
| setState((prevState) => ({ ...prevState, ...newState })); |
| import json | |
| from traceback import format_exc | |
| from django.conf import settings | |
| from django.core.management.base import BaseCommand, CommandError | |
| from djstripe import settings as djstripe_settings | |
| from djstripe.models import Event, WebhookEventTrigger | |
| from djstripe.signals import webhook_processing_error | |
| # from djstripe.utils import convert_tstamp # convert stripe timestamps to datetimes |
| var target = document.querySelector('canvas'); | |
| var input = document.querySelector('input.jscolor'); | |
| var body = document.body; | |
| var rect = target.getBoundingClientRect(); | |
| var irect = input.getBoundingClientRect(); | |
| var brect = document.body.getBoundingClientRect(); | |
| var simulateMouseEvent = function simulateMouseEvent(type, point, elt, eltRect) { | |
| elt = elt || target; |
| import axios, { | |
| AxiosRequestConfig, | |
| Method, | |
| } from 'axios'; | |
| export const makeAxiosRequestConfig = ( | |
| method: Method, | |
| path: string, | |
| data?: { [key: string]: any }, |
| import { generatePath } from 'react-router'; | |
| // ## Route URL | |
| export default class RouteUrl<P extends { [K in keyof P]?: string }> { | |
| constructor(public routePath: string) {} | |
| asPath(params: { [K in keyof P]: string | number | boolean }) { | |
| return generatePath(this.routePath, params); | |
| } |