Skip to content

Instantly share code, notes, and snippets.

View BitsAndAtoms's full-sized avatar

Sid Gupta BitsAndAtoms

View GitHub Profile
@BitsAndAtoms
BitsAndAtoms / better_powershell.md
Created June 25, 2023 21:26 — forked from mh-firouzjah/better_powershell.md
how to add zsh-like theme and feature to windows powershell

Better PowerShell

Theme | History | KeyBinding

MyPowershell

in order to make windows powershell more comfortable and add a some theme and features like history binding, auto complete on keypress and so on, if you have used linux teminl wiht zsh for example, we are going to make powershell like that as much as we can.

What we will achieve

@BitsAndAtoms
BitsAndAtoms / gist:842a4e4103559bf4c5214e064e93bd27
Last active January 16, 2023 08:56
Gist for base 64 windows
# this generates base 64 using powershell
[Convert]::ToBase64String([IO.File]::ReadAllBytes("./Desktop/credentials.json")) > OUTPUT_FILE.txt
@BitsAndAtoms
BitsAndAtoms / git-subdirectory-tracking.md
Created January 16, 2023 08:53 — forked from tswaters/git-subdirectory-tracking.md
Adding subdirectory of a remote repo to a subdirectory in local repo

This is way more complicated than it should be. The following conditions need to be met :

  1. need to be able to track and merge in upstream changes
  2. don't want remote commit messages in master
  3. only interested in sub-directory of another repo
  4. needs to go in a subdirectory in my repo.

In this particular case, I'm interested in bringing in the 'default' template of jsdoc as a sub-directory in my project so I could potentially make changes to the markup it genereates while also being able to update from upstream if there are changes. Ideally their template should be a separate repo added to jsdoc via a submodule -- this way I could fork it and things would be much easier.... but, it is what it is.

After much struggling with git, subtree and git-subtree, I ended up finding this http://archive.h2ik.co/2011/03/having-fun-with-git-subtree/ -- it basically sets up separate branches from tracking remote, the particular sub-directory, and uses git subtree contrib module to pull it all togther. Following are

@BitsAndAtoms
BitsAndAtoms / linuxCommandsHandy.py
Last active November 27, 2022 09:25
Linux commands
git status -u --ignored
ls -lah
top
du -h --max-depth=1 | sort -rh
kilall -u username
disk usage: df -h
@BitsAndAtoms
BitsAndAtoms / unfollow.js
Created July 23, 2022 01:25
Bulk unfollow on linkedn or press a button pretty much anywhere
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
for (let button of buttons) {
count = count + 1;