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 / build.bash
Created Aug 16, 2019
Build a docker image with bash
View build.bash
set -eu
colour() {
tput bold
tput smso
docwhat /
Last active Jul 22, 2019 — forked from abayer/
Declarative Pipeline Docker-with-cleanup agent type
// This would be in src/main/java/whatever/
package whatever;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.jenkinsci.plugins.pipeline.modeldefinition.agent.AbstractDockerAgent;
import org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent;
import org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgentDescriptor;
import org.kohsuke.stapler.DataBoundConstructor;
docwhat / duquesnelight-outages.rb
Created Jul 11, 2019
Check for power outages from Duquesne Light in Pittsburgh.
View duquesnelight-outages.rb
#!/usr/bin/env ruby -w
# frozen_string_literal: true
require 'json'
require 'open-uri'
require 'date'
class Outage
attr_reader :name, :zip, :lat, :long, :number_affected, :last_updated
docwhat / docker-bridge-example.bash
Created Apr 6, 2019
Example of using docker bridge networking
View docker-bridge-example.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 / Jenkinsfile
Last active Sep 6, 2019
Example pipeline usage of the Jenkins Mask Passwords plugin
View Jenkinsfile
// Requires 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 /
Last active Aug 14, 2018

The format of the env-file is explain at

# I'm using bash, but it applies with sh and zsh as well.
# 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 / 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
RUN mkdir -p /usr/share/maven && \
curl -fsSL$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -xzC /usr/share/maven --strip-components=1 && \
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 / 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('') format('opentype');
* {
text-rendering: optimizeLegibility;
docwhat / Jenkinsfile
Created Feb 10, 2017
Jenkinsfile: check scm woes with the GitHub Org Folders
View Jenkinsfile
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
You can’t perform that action at this time.