Skip to content

Instantly share code, notes, and snippets.

Dobes Vandermeer dobesv

Block or report user

Report or block dobesv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dobesv
dobesv / open-tunnel-and-browser.sh
Last active Nov 4, 2019
Helper scripts to open a tunnel to a service in kubernetes and launch the browser to the given service.
View open-tunnel-and-browser.sh
#!/usr/bin/env bash
ENVIRONMENT=$1
NAMESPACE=$2
SERVICE_NAME=$3
DEFAULT_LOCAL_PORT=4000
DEFAULT_TARGET_PORT=80
case $ENVIRONMENT in
@dobesv
dobesv / es-config.txt
Created Jul 24, 2019
Example configuration for fluentd-es namespace per index using record_modifier and elasticsearch
View es-config.txt
<filter kubernetes.**>
@type kubernetes_metadata
</filter>
# Use tag as index name prefix by default
<filter **>
@type record_modifier
<record>
_es_index ${tag_parts[0]}.${Time.at(time).strftime('%F')}
</record>
View .babelrc
{
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{ "ignoreBrowserslistConfig": true, "targets": { "node": true } }
],
"@babel/react"
]
}
@dobesv
dobesv / babel-generic-func-bug_.babelrc
Last active Mar 6, 2019
Reproduce babel typescript bug
View babel-generic-func-bug_.babelrc
{
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{ "ignoreBrowserslistConfig": true, "targets": { "node": true } }
],
"@babel/react"
]
}
@dobesv
dobesv / csvAsyncIterator.ts
Created Feb 20, 2019
Async iterator wrapper for papaparse
View csvAsyncIterator.ts
import Papa, { ParseConfig, Parser } from 'papaparse';
export type CsvAsyncIteratorOptions = Exclude<
ParseConfig,
'step' | 'chunk' | 'complete' | 'error'
>;
/**
* Helper to allow async iteration over the contents of
* a CSV input.
@dobesv
dobesv / dev_cert.sh
Created May 28, 2018
Script to create a local certificate authority and TLS certificate for a given domain name.
View dev_cert.sh
#!/usr/bin/env bash
set -x
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NAME=${1:-localhost}
CA_KEY=$DIR/dev_cert_ca.key.pem
[ -f $CA_KEY ] || openssl genrsa -des3 -out $CA_KEY 2048
@dobesv
dobesv / dev_signed_cert.sh
Created May 18, 2018
Script to create (1) a local certificate authority, (2) a host certificate signed by that authority for the hostname of your choice
View dev_signed_cert.sh
#!/usr/bin/env bash
#
# Usage: dev_signed_cert.sh HOSTNAME
#
# Creates a CA cert and then generates an SSL certificate signed by that CA for the
# given hostname.
#
# After running this, add the generated dev_cert_ca.cert.pem to the trusted root
# authorities in your browser / client system.
#
@dobesv
dobesv / positionSuggestions.js
Created Jan 5, 2018
Code to position draft-js emojis plugin popup in way that it is more likely to be on-screen
View positionSuggestions.js
const getRelativeParent = element => {
if (!element) {
return null;
}
const position = window
.getComputedStyle(element)
.getPropertyValue('position');
if (position !== 'static') {
return element;
View copy-asana-task-markdown-link.js
@dobesv
dobesv / recenter-png-files.sh
Created Jan 27, 2017
Re-center all the pngs in the current folder using ImageMagick
View recenter-png-files.sh
#!/usr/bin/env bash
# Re-center all the pngs in the current folder using ImageMagick
for F in *.png ; do
convert -size $(identify -format '%wx%h' $F) xc:white \( $F -trim \) -gravity center -compose copy -composite $F
done
You can’t perform that action at this time.