This file contains 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
# For macOS users (copy & paste all or one commands at a time) | |
# Last tested Slack version: 4.0.2 | |
$ git clone https://github.com/LanikSJ/slack-dark-mode && \ | |
cd slack-dark-mode && \ | |
chmod +x slack-dark-mode.sh && \ | |
./slack-dark-mode.sh && \ | |
osascript -e 'tell application "Slack" to quit' && \ | |
killall Slack && \ | |
sleep 20 && \ | |
open -a "/Applications/Slack.app" |
This file contains 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
#!/bin/sh | |
export PYTHONPATH=$HOME/usr/opt/pyyaml/lib/python2.6/site-packages | |
python -c ' | |
import sys, json, yaml | |
with open(sys.argv[1]) as f: | |
print yaml.safe_dump(json.load(f), default_flow_style=False) | |
' $@ |
This file contains 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
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml | |
kubectl get pods --namespace kube-system | |
kubectl port-forward kubernetes-dashboard-5569448c6d-jxbhv 8443:8443 --namespace=kube-system | |
git clone https://github.com/dockersamples/k8s-wordsmith-demo | |
cd k8s-wordsmith-demo | |
docker-compose build | |
kubectl apply -f kube-deployment.yml |
This file contains 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
from types import FunctionType | |
class StaticMeta(type): | |
def __new__(cls, name, bases, attrs): | |
"""Metaclass to apply staticmethod decorator to all the methods.""" | |
new_cls = super().__new__(cls, name, bases, attrs) | |
# key is attribute name and val is attribute value in the attrs dict | |
for key, val in attrs.items(): |
This file contains 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
function( d ) { | |
// Create a copy of this date object | |
var target = new Date(d.valueOf()); | |
// ISO week date weeks start on monday | |
// so correct the day number | |
var dayNr = (d.getDay() + 6) % 7; | |
// Set the target to the thursday of this week so the |
This file contains 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
minikube start --vm-driver=virtualbox | |
kubectl get nodes | |
git clone https://github.com/vfarcic/k8s-specs.git | |
cd k8s-specs | |
kubectl run db --image mongo |
This file contains 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
var myEventList = []; | |
function writeData() { | |
document.body.onclick = function(event) { | |
myEventList.push(formatData(event)); | |
}; | |
function formatData(data) { | |
var event = []; | |
event.push({ | |
"x": data.clientX, | |
"y": data.clientY, |
This file contains 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
version: "3.3" | |
services: | |
################################################ | |
#### Traefik Proxy Setup ##### | |
############################################### | |
traefik: | |
image: traefik:v2.3 | |
restart: always |
This file contains 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
# Source: https://gist.github.com/d860631d0dd3158c32740e9260c7add0 | |
minikube start --vm-driver=virtualbox | |
kubectl get nodes | |
git clone https://github.com/vfarcic/k8s-specs.git | |
cd k8s-specs |
This file contains 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
kubectl get services # List all services | |
kubectl get pods # List all pods | |
kubectl get nodes -w # Watch nodes continuously | |
kubectl version # Get version information | |
kubectl cluster-info # Get cluster information | |
kubectl config view # Get the configuration | |
kubectl describe node <node> # Output information about a node | |
kubectl get pods # List the current pods | |
kubectl describe pod <name> # Describe pod <name> | |
kubectl get rc # List the replication controllers |
OlderNewer