Skip to content

Instantly share code, notes, and snippets.

View itsvinayak's full-sized avatar
🎯
Focusing

vinayak itsvinayak

🎯
Focusing
View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

[
{
"id": "5a6ce86e2af929789500e7e4",
"author": "Edsger W. Dijkstra",
"en": "Computer Science is no more about computers than astronomy is about telescopes."
},
{
"id": "5a6ce86e2af929789500e7d7",
"author": "Edsger W. Dijkstra",
"en": "Simplicity is prerequisite for reliability."
@itsvinayak
itsvinayak / scripts.md
Created November 8, 2023 18:39
Sharing a Powerful Bash Script for Streamlined Productivity 🚀

Open Git Repository:

git remote get-url origin | xargs open

Kill Process by Port:

# lsof -i tcp:8080 | awk 'FNR == 2{print $2}' | xargs kill -9
@itsvinayak
itsvinayak / setup_kubernetes_aliases.sh
Created November 1, 2023 17:13
🚀 Elevate your Kubernetes game with our powerful Bash script! Introducing a seamless solution designed for efficiency and productivity. Say goodbye to manual alias setup – our script automates the process, configuring essential Kubernetes aliases in your .bashrc file effortlessly. Supercharge your workflow and boost productivity with just a few …
#!/bin/bash
# Function to add or update an alias in .bashrc
add_alias_to_bashrc() {
local alias_name="$1"
local alias_command="$2"
# Check if the alias already exists in .bashrc
if grep -q "^alias $alias_name=" ~/.bashrc; then
# Update the existing alias
@itsvinayak
itsvinayak / tmux-cheatsheet.markdown
Created June 12, 2023 15:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
eval "$(starship init zsh)"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
sudo apt-get update -y
sudo apt-get install ca-certificates curl gnupg lsb-release -y
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
sudo echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install \
ca-certificates \
curl \

FEATURE EXPECTATIONS [5 min]

    (1) Use cases
    (2) Scenarios that will not be covered
    (3) Who will use
    (4) How many will use
    (5) Usage patterns

ESTIMATIONS [5 min]

    (1) Throughput (QPS for read and write queries)
    (2) Latency expected from the system (for read and write queries)

(3) Read/Write ratio

@itsvinayak
itsvinayak / i3-gaps.sh
Last active November 12, 2020 04:45 — forked from dabroder/i3-gaps.sh
Install i3-gaps on ubuntu 18.04
#!/bin/bash
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake
cd /tmp
# clone the repository
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps
# compile & install
def topDownKnapsack(wt,val,capacity):
dp = [[0 for i in range(capacity+1)] for j in range(len(wt)+1)]
for i in range(len(wt)+1):
for j in range(capacity+1):
if i == 0 or j == 0:
dp[i][j] = 0
elif wt[i-1] <= j:
dp[i][j] = max(
val[i - 1] + dp[i - 1][j - wt[i - 1]],
dp[i - 1][j])