Skip to content

Instantly share code, notes, and snippets.

View ProProgrammer's full-sized avatar

Deep Sukhwani ProProgrammer

View GitHub Profile
@ProProgrammer
ProProgrammer / awesome-cli.md
Last active February 22, 2020 03:01
Awesome Command Line Tools by Amjith Ramanujam

Third in Top 10 Must-Watch PyCon Talks by RealPython

Youtube | Slides | Date: Feb 22, 2020

Things to be super aware of

  • Discoverability - Make your features more obvious/forthcoming, don't hide them behind something (e.g. a particular key stroke combination in case of command line tools)
  • Be User focussed - Whatever you are building an application/feature, user comes first, make it most intutitive and absolutely powerful for the user, implementation should always come next
  • Configurability - Root of all evil! (Inspired by design decisions of Fish Shell) Adding config options means program too stupid to figure out what's best for the user. Configurations should be for subjective options only (e.g. color schemes based on indiv preferences)
@ProProgrammer
ProProgrammer / understanding-pointers.go
Last active June 12, 2019 17:07
Trying to understand pointers in Golang while going through Golang Tour
package main
import "fmt"
func main() {
a := 200
b := &a // Point to memory address of variable a
fmt.Println("Initial value of variable a:", a)
fmt.Println("b := &a, hence value of b:", b)
fmt.Println("Value of *b:", *b) // You can access the value in memory location to whicht he value points using asterisk before the variable name
@ProProgrammer
ProProgrammer / useful_gcloud_kubectl.sh
Last active April 10, 2019 07:34
Some Google Cloud (gcloud) and Kubernetes (kubectl) commands to mess around
# Delete a node-pool
gcloud container node-pools delete pool-n1-standard-4-non-preemptible --region us-central1 --cluster cluster-2 --quiet
# Create a node-pool
gcloud container node-pools create pool-n1-standard-4-non-preemptible --cluster cluster-2 --disk-size 30GB --disk-type pd-ssd --enable-autorepair --enable-autoupgrade --machine-type n1-standard-4 --num-nodes 1 --enable-autoscaling --min-nodes 0 --max-nodes 5 --region us-central1
# Drain a node and delete GCE Instance:
INSTANCE=gke-cluster-2-pool-n1-standard-4-50c3bfa2-fwxn; kubectl drain --delete-local-data --ignore-daemonsets --grace-period=10 $INSTANCE; kubectl delete node $INSTANCE; gcloud compute instances delete $INSTANCE --quiet --zone us-central1-a
OR
for node in $(kubectl get nodes -l cloud.google.com/gke-nodepool=pool-n1-standard-4 -o name); do kubectl drain --ignore-daemonsets --delete-local-data --grace-period=10 ${node}; kubectl delete ${node}; done
@ProProgrammer
ProProgrammer / new-contributor-workshop-part1.txt
Last active October 7, 2018 13:51
Notes from 2018 Kubernetes Contributor Summit EU New Contributor Workshop Part 1 - https://www.youtube.com/watch?v=obyAKf39H38
Watch - 2018 Kubernetes Contributor Summit EU New Contributor Workshop Part 1 - https://www.youtube.com/watch?v=obyAKf39H38
CLA Signing: https://git.k8s.io/community/CLA.md
Actual URL: https://github.com/kubernetes/community/blob/master/CLA.md
SIG == Special Interest Group
Project humans organized in SIGs
Docs and Website
Frontend development
SIGs:
@ProProgrammer
ProProgrammer / main.go
Last active September 29, 2018 14:15
Practicing pointers in Go based on explanation by Shawn here: https://www.youtube.com/watch?v=hMSYabOnA3M
package main
import "fmt"
func main() {
x := 42
fmt.Println("Address of x inside main:", &x)
fmt.Println("Initial value of x inside main before any external functions are called:", x)
fmt.Println("---------------")
@ProProgrammer
ProProgrammer / exercise-maps.go
Created September 26, 2018 23:42
A Tour of Go: Exercise: Maps Implement WordCount. It should return a map of the counts of each “word” in the string s. The wc.Test function runs a test suite against the provided function and prints success or failure. You might find strings.Fields helpful.
package main
import (
"fmt"
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
outputMap := make(map[string]int)
@ProProgrammer
ProProgrammer / index.html
Created September 14, 2018 22:05
Practicing JavaScript Hoisting with https://www.youtube.com/watch?v=sw49K4pxHCU
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JavaScript Hoisting</title>
</head>
<body>
<!-- First check -->
<!-- <script type="text/javascript">
@ProProgrammer
ProProgrammer / Dockerfile
Created August 25, 2018 06:31
Dockerfile used for Dockerfile tutorial on Youtube
# This Dockerfile is used for a youtube tutorial
# base image - nginx with tag "latest"
FROM nginx:latest
# Adding custom index.html hosted on Github Gist
ADD https://gist.githubusercontent.com/ProProgrammer/72a87394affb0a70f54af6e6353e3c45/raw/37fcecc6d43dba55effa9e1fa6f7183f349b9ba0/index.html /usr/share/nginx/html/
# Adding read permissions to custom index.html
RUN chmod +r /usr/share/nginx/html/index.html
@ProProgrammer
ProProgrammer / index.html
Last active June 13, 2023 20:05
Sample HTML File for a Docker tutorial
<!DOCTYPE html>
<html>
<head>
<title>Sample HTML File</title>
<style type="text/css">
body {
background-color: #37474f;
}
h1 b {
font-color: #000000;
@ProProgrammer
ProProgrammer / flatten.py
Created April 1, 2016 17:55
Flatten a list using Python with test cases against the flatten function
def flatten(input_list):
flattened_output = []
for item in input_list:
if isinstance(item, int):
flattened_output.append(item)
else:
flattened_output += flatten(item)
return flattened_output