Skip to content

Instantly share code, notes, and snippets.

View Vaansh's full-sized avatar
🌊
learning & exploring

Vaansh Lakhwara Vaansh

🌊
learning & exploring
View GitHub Profile
@Vaansh
Vaansh / pubsub.py
Created April 5, 2023 17:28
Many to one example
#!/usr/bin/env python
from __future__ import annotations
import logging
import time
from abc import ABC, abstractmethod
from enum import Enum
from multiprocessing import Process
@Vaansh
Vaansh / .bashrc
Created October 8, 2021 20:53
Work .bashrc
# d8888 888 d8b
# d88888 888 Y8P
# d88P888 888
# d88P 888 888 888 8888b. .d8888b .d88b. .d8888b
# d88P 888 888 888 "88b 88K d8P Y8b 88K
# d88P 888 888 888 .d888888 "Y8888b. 88888888 "Y8888b.
# d8888888888 888 888 888 888 X88 Y8b. X88
# d88P 888 888 888 "Y888888 88888P' "Y8888 88888P'
alias g='git'
@Vaansh
Vaansh / gcp.sh
Created September 23, 2021 17:41
function to ease pushing changes made in remote repos for work/school
function gcp() {
echo "> New branch? [+used for remote branch] ('n' or 'no' for no, anything else for yes)"
read newbranch
if [ "${newbranch^^}" != "N" ] && [ "${newbranch^^}" != "NO" ]
then
echo "> Name of new branch: [+used for remote branch]"
read newbranchname
git checkout -b $newbranchname
fi
@Vaansh
Vaansh / code_style.md
Created February 23, 2021 09:29 — forked from jesseschalken/code_style.md
Code style

My preferred code style is 2-space K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty or meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of a block on separate lines from the content.
We couldn’t find that file to show.
Go 21 hrs 9 mins ███████████▎░░░░░░░░░ 53.9%
YAML 9 hrs 31 mins █████░░░░░░░░░░░░░░░░ 24.3%
Markdown 4 hrs 10 mins ██▏░░░░░░░░░░░░░░░░░░ 10.7%
Bash 1 hr 20 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.4%
JSON 34 mins ▎░░░░░░░░░░░░░░░░░░░░ 1.5%