I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
curl -XDELETE localhost:9200/*
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
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
# Example of using an InitContainer in place of a GitRepo volume. | |
# Unilke GitRepo volumes, this approach runs the git command in a container, | |
# with the associated hardening. | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: git-repo-demo | |
annotations: | |
seccomp.security.alpha.kubernetes.io/pod: 'docker/default' | |
spec: |
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
func printAllPermutations(s string) { | |
permute(s, 0, len(s)-1) | |
} | |
func permute(s string, left, right int) { | |
if left == right { | |
fmt.Printf("%s\n", s) | |
} | |
for i := left; i <= right; i++ { |
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/bash | |
NORMAL="\[\e[00m\]" | |
BLACK="\[\e[0;30m\]" | |
RED="\[\e[1;31m\]" | |
GREEN="\[\e[0;32m\]" | |
YELLOW="\[\e[0;33m\]" | |
BLUE="\[\e[0;34m\]" | |
PURPLE="\[\e[0;35m\]" | |
CYAN="\[\e[0;36m\]" |