Skip to content

Instantly share code, notes, and snippets.

View burtonator's full-sized avatar

Kevin Burton burtonator

View GitHub Profile
http://1045theteam.com/jason-day-out-of-rio-olympics/
http://1045theteam.com/pat-summit-passes-away-at-64/
http://1045theteam.com/usa-announces-mens-basketball-roster/
http://247sports.com/Bolt/Agent-Only-way-Durant-leaves-Thunder-is-for-Heat-or-Warriors-45987535
http://247sports.com/Bolt/Kevin-Durant-not-expected-to-meet-with-Lakers-or-Wizards-45984145
http://247sports.com/Bolt/Report-Teams-trying-to-sign-Kevin-Durant-for-2017-not-2016-46000555
http://247sports.com/Bolt/Rockets-will-pursue-Durant-and-other-big-names-in-free-agency-46010526
http://247sports.com/Bolt/Tim-Duncan-will-be-present-at-Spurs-meeting-with-Kevin-Durant-45972170
http://247sports.com/Bolt/Warriors-believe-Durant-odds-increased-due-to-Finals-loss-45971904
http://247sports.com/Bolt/Wojnarowski-Warriors-have-Durants-attention-45977902
{
"common": {
"black": "#000",
"white": "#fff"
},
"type": "dark",
"primary": {
"main": "rgb(103, 84, 214)",
"light": "rgb(133, 118, 222)",
"dark": "rgb(72, 58, 149)",
import firebase from 'firebase/app'
import 'firebase/firestore';
import {Latch} from "polar-shared/src/util/Latch";
import {Tracer} from "polar-shared/src/util/Tracer";
import {Bytes} from "polar-shared/src/util/Bytes";
require('firebase/auth');
async function doTestFirestore() {
const key = {
{
"name": "projects/polar-32b0f/databases/(default)/documents/block/15ChjnUstZ",
"fields": {
"parent": {
"stringValue": "12QNeyXVZ7"
},
"root": {
"stringValue": "12QNeyXVZ7"
},
"nspace": {
@burtonator
burtonator / useLocalStorageState.ts
Last active July 9, 2021 13:03
useLocalStorageState.ts
import React from 'react';
/**
* Implement a replacement for useState which keeps values in the localStorage.
*
* The idea here is that all calls to use useState can be replaced with
* useLocalStorageState(key, initialValue) and implement the same behavior.
*
* The first time useLocalStorageState is called the value will be initialValue
* because nothing is stored in localStorage.
import {assert} from 'chai';
export namespace Dictionaries {
/**
* Create a deep copy of a dictionary such that all of the origina keys are maintained
* and copied into a new dictionary.
*
* This is used when we have to create a copy of a dictionary to prevent concurrent mutation
* or when we need to copy it and then make changes to the new dictionary.
@burtonator
burtonator / RingBuffer.ts
Last active July 8, 2021 16:07
ring buffer...
import {assert} from 'chai';
/**
* Implement a class named ring buffer with fixed capacity such that
*
* constructor: takes the capacity for the ring buffer
*
* push: adds a value to the ring buffer.
* pop: removes the last value from the ring buffer or undefined if it's empty.
* peek: returns the current value of the most recent value added or undefined if none have been added
@burtonator
burtonator / useLocalStorageState.ts
Last active June 14, 2021 17:20
useLocalStorageState
export function useLocalStorageState() {
}
type FetchResponseError = {
readonly code: 'fetch-response-error';
readonly message: string;
readonly status: number;
readonly statusText: string;
};
type FetchError = {
readonly code: 'fetch-error',
readonly message: string;
import {ILTRect} from './rects/ILTRect';
import {Preconditions} from '../Preconditions';
import {DataURL, DataURLs} from './DataURLs';
import {IDimensions} from "./IDimensions";
import {ImageType} from "./ImageType";
const DEFAULT_IMAGE_TYPE = 'image/png';
const DEFAULT_IMAGE_QUALITY = 1.0;