[Kubernetes] Setup a Local Development Environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TFormSubmitOptions = { | |
body?: { [key: string]: any }; | |
method?: string; | |
}; | |
const formSubmit = (endpoint: string, options?: TFormSubmitOptions) => { | |
const { body = {}, method = 'POST' } = options || {}; | |
const form = document.createElement('form'); | |
form.setAttribute('method', method); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = document.getElementById("input"); | |
function debounce(eventListener, msec) { | |
let timer | |
return (...args) => { | |
clearTimeout(timer); | |
timer = setTimeout(() => { | |
clearTimeout(timer); | |
timer = null; | |
eventListener.call(this, ...args); // eventListener(...args) x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a service account for Helm and grant the cluster admin role. | |
# It is assumed that helm should be installed with this service account | |
# (tiller). | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: tiller | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
setopt promptsubst | |
autoload -U add-zsh-hook | |
PROMPT_SUCCESS_COLOR=$FG[117] | |
PROMPT_FAILURE_COLOR=$FG[124] | |
PROMPT_VCS_INFO_COLOR=$FG[242] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// obj === parsed.d.b.q | |
const paginateRef = (ref, obj = {}) => { | |
Object.entries(obj).forEach(([key, value]) => { | |
switch (key) { | |
case "sp": { | |
ref = ref.startAt(value); | |
break; | |
} | |
case "ep": { | |
ref = ref.endAt(value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from "crypto"; | |
const algorithm = "aes-256-cbc"; | |
const Aes256 = (text, key, iv) => { | |
let cipher = crypto.createCipheriv(algorithm, new Buffer.from(key), new Buffer.from(iv)); | |
cipher.setAutoPadding(false); | |
let encrypted = cipher.update(PKCS5Padding(text)); | |
encrypted = Buffer.concat([encrypted]); | |
return encrypted.toString("hex"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"encoding/hex" | |
"fmt" | |
) |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --install
will prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/yingray_lu/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="agnoster" |
NewerOlder