Keybase proof
I hereby claim:
- I am techieshark on github.
- I am techieshark (https://keybase.io/techieshark) on keybase.
- I have a public key ASAGfHHdWMNLxRSipw5fj5uzzNELExUqoXtBuY0RPYw41go
To claim this, I am signing this object:
{ | |
"name": "anything", | |
"version": "0.1.0", | |
"dependencies": { | |
"@mapbox/mapbox-sdk": "^0.10.0", | |
"@mapbox/polyline": "^1.1.0", | |
"@material-ui/core": "^4.8.2", | |
"@material-ui/icons": "^4.5.1", | |
"@turf/circle": "^6.2.0-alpha.1", | |
"@turf/distance": "^6.2.0-alpha.1", |
// __mocks__/stripe.ts: Jest Mock for Stripe class | |
/** | |
* Fake a response from stripe.customers.list(). | |
* @example | |
* mockStripeCustomerList(1) === { data: ['fake customer'], object: 'list', … } | |
* @param count number of fake customers to return | |
*/ | |
export const mockStripeCustomerList = (count: number) => ({ | |
data: (new Array(count)).fill('fake customer'), |
import { NO_CONTENT } from 'http-status-codes'; | |
const send204 = (req: Request, res: Response, next: NextFunction) => { | |
res.status(NO_CONTENT); | |
res.end(); | |
}; |
import { NextFunction, Request, Response } from 'express'; | |
/** | |
* Sets Allow header. | |
* | |
* "The Allow header lists the set of methods support by a resource. | |
* This header must be sent if the server responds with a 405 Method Not Allowed | |
* status code to indicate which request methods can be used." | |
* | |
* |
/** | |
* Returns whether the current browser supports | |
* the `locales` argument of Number.prototype.toLocaleString(). | |
* IE < 11 does not. | |
* Copied from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Checking_for_support_for_locales_and_options_arguments | |
* @return {boolean} true if browser supports it, otherwise false. | |
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Browser_compatibility | |
*/ | |
function toLocaleStringSupportsLocales() { | |
const number = 0; |
// @flow | |
// Flow-typed version of Object.values() | |
// @see: problem - https://github.com/facebook/flow/issues/2221 | |
// @see: this solution - https://stackoverflow.com/a/51757027/1024811 | |
export default function objectValues<A, B>(obj: {[key: A]: B}): Array<B> { | |
return ((Object.values(obj): any): Array<B>); | |
} |
// @flow | |
/** | |
* Returns new object made of the picked paths. | |
* Native implementation of lodash `pick`. | |
* Shaves 1-2kb off download size: https://bundlephobia.com/result?p=lodash.pick@4.4.0. | |
* @see https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_pick | |
* @see https://lodash.com/docs/#pick | |
* @return {Object} | |
*/ |
/* | |
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
*/ | |
SET NAMES utf8; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS postcodes_geo; |
/** | |
* Remove a CSS class from an HTML element. | |
* @param {HTMLElement} el The HTML element to modify. | |
* @param {string} className The class to remove. | |
* @returns null | |
* @see http://youmightnotneedjquery.com/#remove_class | |
*/ | |
function removeClass(el, className) { | |
if (el.classList) | |
el.classList.remove(className); |
I hereby claim:
To claim this, I am signing this object: