Skip to content

Instantly share code, notes, and snippets.

View SaiMun92's full-sized avatar

Lee Sai Mun SaiMun92

  • SAP
  • Singapore
View GitHub Profile
@SaiMun92
SaiMun92 / kubectl-shortcuts.sh
Created June 22, 2023 00:50 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@SaiMun92
SaiMun92 / FindRotationPoint.py
Created October 18, 2019 08:55
FindRotationPoint
import unittest
def find_rotation_point(words):
first_word = words[0]
floor_index = 0
ceiling_index = len(words) - 1
while floor_index < ceiling_index:
@SaiMun92
SaiMun92 / HighestProductOf3.py
Created October 16, 2019 05:56
Highest Product of 3
def highest_product_of_3(list_of_ints):
if len(list_of_ints) < 3:
raise ValueError('Less than 3 items!')
# We're going to start at the 3rd item (at index 2)
# so pre-populate highests and lowests based on the first 2 items.
# We could also start these as None and check below if they're set
# but this is arguably cleaner
highest = max(list_of_ints[0], list_of_ints[1])
@SaiMun92
SaiMun92 / MergedSortedArray.py
Created October 9, 2019 07:10
Merged Sorted Array
import unittest
def merge_lists(my_list, alices_list):
merged_list_size = len(my_list) + len(alices_list)
merged_list = [None] * merged_list_size
current_index_alices = 0
current_index_mine = 0
current_index_merged = 0