Skip to content

Instantly share code, notes, and snippets.

Christian Höltje docwhat

Block or report user

Report or block docwhat

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
@docwhat
docwhat / docker-bridge-example.bash
Created Apr 6, 2019
Example of using docker bridge networking
View docker-bridge-example.bash
#!/bin/bash
PS4='+\[\033[01;34m\](${BASH_SOURCE[0]}:${LINENO})\[\033[00m\]: ${FUNCNAME[0]:+\[\033[01;33m\]${FUNCNAME[ 0]}()\[\033[00m\]: }'
set -eu
# Tear Down previous run
{
docker container rm -f db client || true
docker network rm majidi || true
@docwhat
docwhat / Jenkinsfile
Last active Apr 29, 2019
Example pipeline usage of the Jenkins Mask Passwords plugin
View Jenkinsfile
// Requires https://plugins.jenkins.io/mask-passwords to run
/**
* Runs code with secret environment variables and hides the values.
*
* @param varAndPasswordList - A list of Maps with a 'var' and 'password' key. Example: `[[var: 'TOKEN', password: 'sekret']]`
* @param Closure - The code to run in
* @return {void}
*/
def withSecretEnv(List<Map> varAndPasswordList, Closure closure) {
@docwhat
docwhat / example.md
Last active Aug 14, 2018
docker-envfile-example
View example.md

The format of the env-file is explain at https://docs.docker.com/compose/env-file/.

# I'm using bash, but it applies with sh and zsh as well.
$ echo $BASH_VERSION
4.4.23(1)-release
# Create a simple env-file for testing.  We're using = and ! to
# push at some corner cases.
$ echo 'THISISAVARIABLE=This is the value that even has an = sign!' > /tmp/concoction.env
$ cat /tmp/concoction.env
@docwhat
docwhat / Dockerfile
Created May 18, 2018
Multi-stage maven dockerfile with caching
View Dockerfile
# Requires docker 17.06 to build
# ----
# Install Maven
FROM openjdk:8-jdk-alpine AS maven
RUN apk add --no-cache curl tar bash
ARG MAVEN_VERSION=3.3.9
ARG USER_HOME_DIR="/root"
RUN mkdir -p /usr/share/maven && \
curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -xzC /usr/share/maven --strip-components=1 && \
@docwhat
docwhat / async-requires1.js
Created Mar 23, 2018
Debugging Gist slowness
View async-requires1.js
This file has been truncated, but you can view the full file.
// prefer default export if available
const preferDefault = m => m && m.default || m
exports.components = {
"component---src-templates-post-js": require("gatsby-module-loader?name=component---src-templates-post-js!/Users/docwhat/Play/WebSites/docwhat/src/templates/post.js"),
"component---src-templates-page-js": require("gatsby-module-loader?name=component---src-templates-page-js!/Users/docwhat/Play/WebSites/docwhat/src/templates/page.js"),
"component---cache-dev-404-page-js": require("gatsby-module-loader?name=component---cache-dev-404-page-js!/Users/docwhat/Play/WebSites/docwhat/.cache/dev-404-page.js"),
"component---src-pages-all-js": require("gatsby-module-loader?name=component---src-pages-all-js!/Users/docwhat/Play/WebSites/docwhat/src/pages/all.js"),
"component---src-pages-index-js": require("gatsby-module-loader?name=component---src-pages-index-js!/Users/docwhat/Play/WebSites/docwhat/src/pages/index.js"),
@docwhat
docwhat / nerd-firacode-font.css
Last active Oct 13, 2018 — forked from danielfullmer/nerd-font.css
blinksh font configuration file
View nerd-firacode-font.css
@font-face {
font-family: 'Nerd FiraCode Retina';
src: local('Nerd FireCode Retina'), url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/2.0.0/patched-fonts/FiraCode/Retina/complete/Fura%20Code%20Retina%20Nerd%20Font%20Complete.otf') format('opentype');
}
* {
text-rendering: optimizeLegibility;
}
@docwhat
docwhat / Jenkinsfile
Created Feb 10, 2017
Jenkinsfile: check scm woes with the GitHub Org Folders
View Jenkinsfile
#!groovy
node {
stage('desired') {
// This is what I'd like to be able to do... Though there are lots of other extenions that are useful, like
// CleanBeforeCheckout and PruneStaleBranch
// Don't forget submodule configuration!
scm.extenions = scm.extensions + [[$class: 'CloneOption', noTags: true, reference: '', shallow: true]]
checkout scm
}
@docwhat
docwhat / .gitignore
Last active Nov 6, 2016
zsh-syntax-hightling + zsh-autocorrect breaks history-incremental-pattern-search-backward
View .gitignore
/zsh-autosuggestions/
/zsh-syntax-highlighting/
@docwhat
docwhat / Gather Windows.applescript
Created Sep 8, 2016
Gather Windows: useful when disconnecting a second monitor
View Gather Windows.applescript
-- Variation on
-- http://zach.in.tu-clausthal.de/software/Move%20Windows%20To%20Main%20Display.scpt.gz
--
-- Differences:
-- All windows that are more or less off-screen (no matter how much) are moved back
-- so that they are completely on screen (if possible).
-- Gabriel Zachmann, Jan 2008
-- List of processes to ignore (example {"xGestures", "OtherApp", ...})
property processesToIgnore : {"Typinator", "Google Chrome Helper"}
@docwhat
docwhat / .gemrc
Last active Jul 15, 2016
Bug in ChefDK's setting of --user flag
View .gemrc
install: --no-document
update: --no-document
You can’t perform that action at this time.