- 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
)
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 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 |
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 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; | |
}; |
// Detect autoplay | |
// --------------- | |
// This script detects whether the current browser supports the | |
// autoplay feature for HTML5 Audio elements, and it sets the | |
// `AUTOPLAY` variable accordingly. | |
// Used in the Meteor app [PicDinner](http://picdinner.com) |
import PropTypes from 'prop-types'; | |
import React, { Component } from 'react'; | |
import { StripeProvider } from 'react-stripe-elements'; | |
export default class AsyncStripeProvider extends Component { | |
static propTypes = { | |
apiKey: PropTypes.string.isRequired | |
}; | |
// constructor |
frontend: | |
customHeaders: | |
# cache static assets! (can I just use a glob for this, e.g., '**/*.{js,css,gif,ico,jpg,png,svg,mp4,webm}' ?) | |
# js | |
- pattern: '**/*.js' | |
headers: [ { key: 'Cache-Control', value: 'public,max-age=31536000,immutable' } ] | |
# css | |
- pattern: '**/*.css' | |
headers: [ { key: 'Cache-Control', value: 'public,max-age=31536000,immutable' } ] | |
# images |
export function groupCollapsedFn<F extends Function>( | |
msg: any, func: F, | |
): F; | |
export function groupFn<F extends Function>( | |
msg: any, func: F, isCollapsed?: boolean | |
): F; |
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) { |