Skip to content

Instantly share code, notes, and snippets.

View torbjoernk's full-sized avatar

Torbjörn Klatt torbjoernk

View GitHub Profile
@yuanying
yuanying / kubectl-run-with-pvc.sh
Last active January 26, 2024 13:58
kubectl run with PVCs
#!/bin/bash
IMAGE="gcr.io/google-containers/ubuntu-slim:0.14"
COMMAND="/bin/bash"
SUFFIX=$(date +%s | shasum | base64 | fold -w 10 | head -1 | tr '[:upper:]' '[:lower:]')
usage_exit() {
echo "Usage: $0 [-c command] [-i image] PVC ..." 1>&2
exit 1
}
@pyrtsa
pyrtsa / gist:2275320
Created April 1, 2012 13:27
C++11 metaprogramming
// Here are a few tricks I've used with the trunk versions of clang and libc++
// with C++11 compilation turned on. Some might be obvious, some not, but at
// least they are some kind of improvement over their C++03 counterparts.
//
// Public domain.
// =============================================================================
// 1) Using variadic class templates recursively, like in the definitions for
// "add<T...>" here:
@stuartpb
stuartpb / example.lua
Last active December 14, 2021 18:11
Lua script for fancy named parameters with default values
local fp = require "fancyparams"
myfunction = fp(
{{"a"},{"b",7},{"c",5}},
function(a, b, c)
print(a, b, c)
end
)