Skip to content

Instantly share code, notes, and snippets.

View weyert's full-sized avatar
🏠
Reading about ancient history

Weyert de Boer weyert

🏠
Reading about ancient history
  • London, Curaçao
View GitHub Profile
const DashboardRoute = (props) => {
const { component: Component, isAuthenticated, ...rest } = props;
return (
<Route
{...rest}
render={matchProps => {
return isAuthenticated ? (
<DashboardLayout>
<Component {...props} />
</DashboardLayout>
@weyert
weyert / new
Last active April 9, 2019 10:42
dokku report
root@ip-10-77-16-149:~# dokku report
-----> uname: Linux ip-10-77-16-149 4.4.0-1079-aws #89-Ubuntu SMP Tue Mar 26 15:25:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
total used free shared buff/cache available
Mem: 3891 747 380 11 2763 2803
Swap: 0 0 0
-----> docker version:
Client:
Version: 18.09.0
API version: 1.39
@weyert
weyert / cra config file
Last active August 21, 2020 23:36
Config for CRA vs plain JEST
{
"configs": [
{
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/qg/y_s5wnyd71nd33zg9z1_76tw0000gn/T/jest_dx",
"clearMocks": false,
"coveragePathIgnorePatterns": [
"/node_modules/"
],
@weyert
weyert / helper.ts
Created November 27, 2020 16:20
Helper method to use DOM Testing Library inside frames
async function getFrameDocument(frame: Frame): Promise<ElementHandle> {
const documentHandle = await frame.evaluateHandle<Node>('document')
const document = documentHandle.asElement()
if (!document) {
throw new Error('Failed to find Document in frame')
}
return document
}
async function getQueriesByFrame(frame: Frame) {
@weyert
weyert / generate-slo-configmap.sh
Last active October 28, 2021 19:19
Generate config map for Sloth SLO definitions using Customise
sloth_version="0.8.0"
# get the name of the operating system
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'FreeBSD' ]]; then
platform='freebsd'
elif [[ "$unamestr" == 'Darwin' ]]; then