Skip to content

Instantly share code, notes, and snippets.

View superbrothers's full-sized avatar
🌏
Working from the earth

Kazuki Suda superbrothers

🌏
Working from the earth
View GitHub Profile
#!/usr/bin/env zsh
set -e
__handle_flag() {
local flagname="--namespace="
local flagval="kube-system"
flaghash[${flagname}]=${flagval}
@superbrothers
superbrothers / assign-priority-attendees.js
Last active October 3, 2017 06:31
Assign priority attendees on connpass
var ids = "ian,superbrothers"; // comma-separated list of connpass ids
ids.split(",").forEach(function (id) {
var href = "/user/" + id + "/";
var node = document.querySelector('td.name a[href="' + href + '"]');
if (node === null) {
console.error(id);
return;
};
#!/usr/bin/env bash
set -e
function minikube_dnsmasq_macos() {
local ip
case $1 in
start)
command minikube "$@"
@media (min-width: 1200px) {
.sharedHeader_inner,
.teamSubHeader_inner,
.teamMain_inner {
width: 100% !important;
}
.teamSidebarContainer_main {
width: 75% !important;
}
.teamSidebarContainer_sub {
#!/usr/bin/env bash
set -e
tempfile="$(mktemp)"
trap "rm -rf $tempfile" EXIT
dd if=/dev/zero of=$tempfile bs=1M count=1
start="$(date +%s%N)"
apiVersion: v1
kind: Service
metadata:
name: default-http-backend
namespace: kube-system
labels:
k8s-app: default-http-backend
spec:
selector:
k8s-app: default-http-backend
setopt prompt_subst
FOUND_KUBECTL=0
if which kubectl >/dev/null 2>&1; then
FOUND_KUBECTL=1
fi
function kubernetes_current_context() {
local context="$(kubectl config current-context)"
[ $? -eq 0 ] && echo "$context" || echo "no context"
let g:lightline = {
\ 'colorscheme': 'jellybeans',
\ 'mode_map': { 'c': 'NORMAL' },
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'gitgutter', 'filename' ], [ 'go' ] ]
\ },
\ 'component': {
\ 'go': '%#goStatuslineColor#%{LightLineGo()}%*',
\ },
\ 'component_function': {
#!/usr/bin/env bash
set -e
ruby -rjson -ryaml -e "puts JSON.dump YAML.load STDIN" | jq $@
# vim: set ft=sh :
@superbrothers
superbrothers / main.go
Created September 8, 2016 02:42
http request with context in Go
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
)