Skip to content

Instantly share code, notes, and snippets.

@windworst
windworst / kustomize_vars.md
Created February 14, 2022 04:02 — forked from hermanbanken/kustomize_vars.md
Kustomize Vars example

This was initially posted in an kubernetes-sigs/kustomize issue.

We are using Kustomize's vars feature. Initially we didn't understand how to use it for our purpose, but it is a 100% fit. One example is our Ingress resource, which looks like this:

# file: base/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: services
@windworst
windworst / Observable.h
Created October 18, 2018 10:28
Observable
#ifndef OBSERVABLE_H
#define OBSERVABLE_H
#include <functional>
template<typename T, typename E>
class Observer
{
public:
const std::function<void(T)> onNext;
@windworst
windworst / git-docker
Created October 6, 2018 14:48
[git-docker] #Git #Shell
docker run -t --rm -v "$HOME":/root -v "$PWD":"$PWD" -w "$PWD" alpine/git "$@"
alias git="docker run -it --rm -v \"\$HOME\":/root -v \"\$PWD\":\"\$PWD\" -w \"\$PWD\" alpine/git \"\$@\""
@windworst
windworst / git-count
Created October 6, 2018 14:41
[git count] #Shell #Git
# 格式化输出 log
git config --global alias.log-format '!git log --pretty=tformat: --numstat'
# 统计格式化输出的内容
git config --global alias.count '!awk "{ add += \$1 ; subs += \$2 ; loc += \$1 - \$2 } END { printf \"\033[31m+\033[0m:%s \033[32m-\033[0m:%s \033[33m△\033[0m:%s\n\",add,subs,loc }"'
@windworst
windworst / videocj.sh
Last active April 11, 2018 16:28 — forked from imcaspar/videocj.sh
edit display
#!/bin/bash
#cut/join videos using ffmpeg without quality loss
if [ "$(uname)" == "Darwin" ]; then
if ! [ -x "$(command -v brew)" ]; then
echo 'homebrew is not installed.'
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if ! [ -x "$(command -v ffmpeg)" ]; then
echo 'ffmpeg is not installed.'
@windworst
windworst / shudu.c
Last active December 17, 2015 18:39
sudoku
#include <stdio.h>
#define N 9
#define N_BOX 3
int mat[N][N] = {0};
int mat_set[N][N] = {0};
int g_judge_count = 0;