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
@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
@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 / 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 / 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
const DashboardRoute = (props) => {
const { component: Component, isAuthenticated, ...rest } = props;
return (
<Route
{...rest}
render={matchProps => {
return isAuthenticated ? (
<DashboardLayout>
<Component {...props} />
</DashboardLayout>
@weyert
weyert / Auth.js
Created March 13, 2017 19:28
Trails annotations
const Annotation = require('ecmas-annotations').Annotation
const _ = require('lodash')
/**
* @module Auth
* @description Auth annotation
*/
module.exports = class Auth extends Annotation {
constructor(data, filePath) {
@weyert
weyert / gist:3175993
Created July 25, 2012 12:46
Problem with ExtJS 4.1
Ext.ns('App');
Ext.Loader.setConfig({ enabled : true, disableCaching : true });
Ext.Loader.setPath('Sch', '');
Ext.require([
'Sch.panel.SchedulerGrid',
'Sch.plugin.Pan',
'Sch.plugin.SimpleEditor',
'Sch.plugin.Lines',
@weyert
weyert / gist:1287611
Created October 14, 2011 16:33
Madness!
package sounds
{
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.SampleDataEvent;
import flash.media.Sound;
import flash.utils.ByteArray;
/**
* RandomlyPlaylist
@weyert
weyert / gist:1099785
Created July 22, 2011 16:24
Animations
private function onViewsUpdate():void
{
for each ( var item: AnimatedNumberView in _numberViews )
{
if ( item.animating )
{
item.currentValue++;
if ( item.currentValue > 9 ) {
item.currentValue = 0;
}
$GLOBALS['TL_DCA']['tl_page']['list']['operations']['clearcomments'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_page']['clearcomments'],
'href' => 'act=clearcomments',
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();"',
'button_callback' => array('WikiContentAccess', 'showActionButton')
);