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
// Wait for this to land: https://github.com/zloirock/core-js/pull/732 | |
// Then use this custom markup parser in <LocalizationProvider> as <template> doesn't work in IE11. | |
const parser = new DOMParser(); | |
function parseMarkup(str: string) { | |
const doc = parser.parseFromString(`<body>${str}</body>`, "text/html"); | |
return Array.from(doc.body.childNodes); | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am cvle on github. | |
* I am cvle (https://keybase.io/cvle) on keybase. | |
* I have a public key ASCX-4HrgTiKXO9jvtvQvDJMuYrj0YV5KHpuAaotBuoRkgo | |
To claim this, I am signing this object: |
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
// Jest assertions will not fail if they live inside a try-catch block due to | |
// https://github.com/facebook/jest/issues/3917. | |
// This file returns a version of `expect` that fails | |
// the test immediately when an exception is thrown. | |
/** | |
* isPromise detects whether given object is a promise or not. | |
*/ | |
const isPromise = obj => |
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 from "react"; | |
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>; | |
type InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps> = | |
<P extends TInjectedProps>( | |
component: React.ComponentType<P> | |
) => React.ComponentType<Omit<P, keyof TInjectedProps> & TNeedsProps>; | |
type DefaultingInferableComponentEnhancer<TInjectedProps> = |
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
const Proxy = require('http-mitm-proxy'); | |
const proxy = Proxy(); | |
const port = 8081; | |
const host = '0.0.0.0'; | |
function appendToBody(chunk, s) { | |
return new Buffer(chunk.toString().replace(/<\/body>/g, s + '</body>')); | |
} | |
proxy.onError(function(ctx, err) { |
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
find folder/ -type f -name '*.js' | xargs sed -i 's/addNotification/notify/g' |
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
{ | |
"data": { | |
"__schema": { | |
"queryType": { | |
"name": "RootQuery" | |
}, | |
"mutationType": { | |
"name": "RootMutation" | |
}, | |
"subscriptionType": { |
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
#!/bin/bash | |
# This script performs a live snapshotting of 3 Volumes from 3 different deployments simultaneously. | |
set -Eeuo pipefail | |
GCLOUD=gcloud | |
KUBECTL=kubectl | |
KVFCTL="docker run --net host --rm wikiwi/kube-volume-freezer kvfctl" | |
NAMESPACE=default |