programming

All About My Custom Hugo Theme KMT

My ToDo List for 2024 (daily updates)

Git Cheatsheet | Distributed Version Control System

git 🔗 Distributed version control system. Execute a Git subcommand: git subcommand Execute a Git subcommand on a custom repository root path: git -C path/to/repo subcommand Execute a Git subcommand with a given configuration set: git -c 'config.key=value' subcommand Display help: git --help Display help for a specific subcommand (like clone, add, push, log, etc.): git help subcommand Display version: git --version git submodule 🔗 Inspects, updates and manages submodules.

kubectl Cheatsheet | Kubernetes

kubectl 🔗 kubectl is a command-line interface for running commands against Kubernetes clusters. List information about a resource with more details: kubectl get pod|service|deployment|ingress|... -o wide Update specified pod with the label ‘unhealthy’ and the value ’true’: kubectl label pods name unhealthy=true List all resources with different types: kubectl get all Display resource (CPU/Memory/Storage) usage of nodes or pods: kubectl top pod|node Print the address of the master and cluster services:

kube fzf Cheatsheet | fuzzy searching of Kubernetes Pods

kube-fzf is an opensource commandline tool to fuzzy search Kubernetes Pods. Shell commands for command-line fuzzy searching of Kubernetes Pods. Get pod details (from current namespace): findpod Get pod details (from all namespaces): findpod -a Describe a pod: describepod Tail pod logs: tailpod Exec into a pod’s container: execpod shell_command Port-forward a pod: pfpod port_number More commandline utilities dealing with Kubernetes: kubectl, kubens, kubeadm, kubetail and kubectx. Read other similar software cheatsheets: fzf and sk .

sk Cheatsheet | Skim Fuzzy Finder

sk is an opensource fuzzy finder written in Rust. Start skim on all files in the specified directory: find path/to/directory -type f | sk Start skim for running processes: ps aux | sk Start skim with a specified query: sk --query "query" Select multiple files with Shift + Tab and write to a file: find path/to/directory -type f | sk --multi > path/to/file Read other similar software cheatsheets: fzf and kube-fzf .

fzf Cheatsheet | fuzzy finder

fzf is an opensource command-line fuzzy finder. Start fzf on all files in the specified directory: find path/to/directory -type f | fzf Start fzf for running processes: ps aux | fzf Select multiple files with Shift + Tab and write to a file: find path/to/directory -type f | fzf --multi > path/to/file Start fzf with a specified query: fzf --query "query" Start fzf on entries that start with core and end with either go, rb, or py:

adb Cheatsheet | Android Debug Bridge

adb 🔗 Android Debug Bridge: communicate with an Android emulator instance or connected Android devices. Check whether the adb server process is running and start it: adb start-server Terminate the adb server process: adb kill-server Start a remote shell in the target emulator/device instance: adb shell Push an Android application to an emulator/device to be installed: adb install -r path/to/file.apk Copy a file/directory from the target device: adb pull path/to/device_file_or_directory path/to/local_destination_directory Copy a file/directory to the target device:

Should I Use HTML Entity or SVG ?

I am designing the breadcrumb in one of my websites I work on. I am thinking of the separator of the navigation path. Should I use homepage > blog > post or homepage / blog / post or homepage | blog | post. I decided to use > but should I use the angle bracket or greater than symbol > or › or an SVG ? SVG : Scalable Vector Graphics 🔗 I tried SVG, and the result is like this.

How to store prices efficiently in Laravel Eloquent ?

We can store prices efficiently in Laravel Eloquent by focusing on avoiding floating-point issues and optimizing storage. The appraoch is storing price as integer. Here is how. How to store prices as integer ? 🔗 Define an integer column in your database table to store the price in the smallest denomination of your currency. For example, for USD, store the price in cents (e.g., $10.50 becomes 1050). Use a mutator in your Eloquent model to handle price setting.

Go Language Cheatsheet

Hello world 🔗 create a new directory with a name like hellogo. create a new file inside with the name main.go. add this code inside that main.go file. package main import "fmt" func main() { message := greetMe("world") fmt.Println(message) } func greetMe(name string) string { return "Hello, " + name + "!" } open the directory in a Terminal, and run go mod init hellogo then go mod tidy then build the project with go build main.

All Terminal Emulator Commands for Android

Terminal is a program to use your operating system in a CLI mode. CLI stands for command line interface. Terminal emulator is a program to emulate the terminal on Android smartphones. Here are all the commands for the Android terminal emulator. moving between directories 🔗 command meaning ls list all files and directories inside in the current directory ls /sbin list all files inside /sbin which are the system programs because /sbin is where system programs go cd change directory to home directory cd ~ change directory to home directory cd /system/etc/ change directory (a.