Skip to content

Instantly share code, notes, and snippets.

View yokawasa's full-sized avatar
:octocat:
debugging

Yoichi Kawasaki yokawasa

:octocat:
debugging
View GitHub Profile
@yokawasa
yokawasa / istio-circuit-breaker.md
Last active February 11, 2022 02:27
Testing Istio Circuit Breaker

Setup an environment for testing

Setup Kind cluster and Istio

Create kind cluster manifest

cat << EOF | > cluster.yaml 
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4 
nodes:
@yokawasa
yokawasa / js-closure.md
Last active February 6, 2022 13:23
JavaScript Programming ( Sutras 写経 of Software Design 2022/02)

Closure in JavaScript

Closureとは? - 定義時のコンテキストへの参照を持つ関数。JSでは関数を作成すると裏側でクロージャが作成され、関数がどこからも参照されなくなるとクロージャも消失する

  • Callオブジェクト(Activation Object): 関数が呼び出されたときに自動的に生成されるオブジェクト。複数回呼び出されると、それごとにCallオブジェクトが生成される
    • 下記の例の場合、変数cntはcreateCounterのCallオブジェクトに格納されているのでそこで変数cntは解決される
    • このCallオブジェクト自体へはプログラムから直接参照・操作できず、show関数を介してのみアクセス可能
    • → これがクロージャを利用して擬似的にプライベート変数を実現するテクニックのカラクリ
const createCounter = function() {
@yokawasa
yokawasa / jq-filter.md
Last active May 31, 2022 20:29
jq filter snippets

jq filter snippets

snippets

cat <file> | jq -c '.[] | select( .<key> | contains("<value>"))'

cat <file> | jq '.items[0]' 

cat <file> | jq '.items[0] | select( .number == 3555 )'
@yokawasa
yokawasa / excel-functions.md
Last active November 12, 2021 00:32
Excel Functions Memo

IF

# IF with ISBLANK
=IF(ISBLANK(CE8),CE7,CE8)
# IF with EQ
=IF(EQ(D3,”m5.large”),E3,0)

SUM & SUMIF

SUMIF(condition range, condition, sum range)

@yokawasa
yokawasa / secretize-secret-generator-plugin.md
Last active October 17, 2021 09:59
secretize - SecretGenerator plugin for external secret services

Quickstart

Build secretize binary

build secretize binary

git clone https://github.com/bbl/secretize
cd secretize
# build secretize binary named secretize
make
@yokawasa
yokawasa / ghcr.md
Last active May 20, 2024 09:51
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@yokawasa
yokawasa / stuffs-for-copy-and-paste.md
Last active October 4, 2021 22:50
Stuffs for Copy and Paste

Characters

│ ┃
┨ ┥ ┤ ┫
┣ ┠ ┝ ├
┌ ┏
└ ┗
┗┻━┛ ┏┳━┓
└┴─┘ ┌┬─┐
@yokawasa
yokawasa / iterm2-composer.md
Last active October 3, 2021 05:35
iTerm2 Composer memo
@yokawasa
yokawasa / google-slides-tips.md
Last active April 17, 2022 12:36
Tips on presentation with Google Slides

how to share presentation with full screen and speaker note in Google slides

  1. Start your presentation with speaker note mode

  2. Put browser focus on presentation screen

  3. Make the presentation full secreen by choosing Chrome menu "display" > "full screen"

  4. Then move the speaker note screen to the fulled screen, which make the screen split into speaker note and presentaion parts. Alternatively if you have spearate screen, it may be good idea to move to speaker note to the other screen so you can share only presentation screen with full size and still can see speaker note on the other screen

@yokawasa
yokawasa / kubebuilder-tips.md
Last active February 10, 2022 20:55
Kubebuilder Tips

Kubebuilder Tips

Bootstrapping

Kuberbuilder init & create api

# kubebuilder init
kubebuilder init --domain my.domain.com --repo github.com/my-org/my-operator

# define resources