Skip to content

Instantly share code, notes, and snippets.

View teivah's full-sized avatar
🧮
Current status: teivah/majorana

Teiva Harsanyi teivah

🧮
Current status: teivah/majorana
View GitHub Profile
#!/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\]"
@teivah
teivah / permutations.go
Created August 8, 2019 21:01
How to display all the possible permutations of a string in Go?
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++ {
@tallclair
tallclair / git-repo-demo.yaml
Created March 9, 2018 19:54
More secure GitRepo volumes
# 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:
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 07:01
Summary of 'Clean code' by Robert C. Martin

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.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@diegopacheco
diegopacheco / elasticsearch-es-delete-all-data.md
Created August 10, 2016 21:36
How to Delete All Data in Elasticsearch?
curl -XDELETE localhost:9200/*
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 6, 2024 02:17
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

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!






\