Skip to content

Instantly share code, notes, and snippets.

Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@sub-mod
sub-mod / Mac OS X: Open in Visual Studio Code
Created September 2, 2020 19:43 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@sub-mod
sub-mod / SharedInformer.md
Created December 29, 2019 23:46 — forked from songbinliu/SharedInformer.md
Notes about Kubernetes SharedInformer

Kubernetes SharedInformer

Overview

SharedInformer has a shared data cache, and is able to distribute notifications for changes to the cache to multiple listeners who have registered to it. SharedInformer is also a "Producer-Consumer" framework, using Controller as Producer to produce the Events (, or changes to the cache).

@sub-mod
sub-mod / Reflector.md
Created December 29, 2019 23:45 — forked from songbinliu/Reflector.md
description the implementation and usage of kubernetes reflector.

Kubernetes Reflector

Reflector is a key component for Kubernetes clients, kube-scheduler and Replication Controller. Reflector is in the middle between client and Kubernetes API-server. It provides a framework to monitor the changes of the Kubernetes cluster.

Definition of Reflector

Here is the definition of Reflector. reflector define

As shown in the definition, there are two important compoents of a Reflector:

---
apiVersion: v1
data:
jupyterhub_config.py: |
import json
import os
from kubespawner.spawner import KubeSpawner
from jhub_remote_user_authenticator.remote_user_auth import RemoteUserAuthenticator
from oauthenticator.github import GitHubOAuthenticator