Skip to content

Instantly share code, notes, and snippets.

@Saakshaat
Saakshaat / Custom.json
Created May 31, 2021 18:50
iTerm2 Configs
{
"Custom Directory" : "Recycle",
"Working Directory" : "\/Users\/Apple1",
"Prompt Before Closing 2" : false,
"Selected Text Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Alpha Component" : 1,
"Green Component" : 0
@Saakshaat
Saakshaat / encrypt.py
Last active April 25, 2021 18:46
JWT Generator
import json
import base64
import secrets
import hmac
import hashlib
# secret = 'SECRET' # uncomment this if you want constant secret
def jwt_gen(message, alg):
@Saakshaat
Saakshaat / create.py
Created December 22, 2020 21:13
Resolve Relationships with SQLAlchemy Inspect
from pydantic import BaseModel
from sqlalchemy import inspect
from models.base import Model
def get_all_relationships(model):
inspector = inspect(model)
return inspector.relationships
@Saakshaat
Saakshaat / README.md
Created December 3, 2020 06:46
Python Local Serverless Lambda
@Saakshaat
Saakshaat / check_if_spotify_is_running
Created August 6, 2020 23:09
Simple script and cron job for ad skips on spotify
# make sure that it's executable by chmod +x check_if_spotify_is_running
if pgrep Spotify; then
osascript -e 'quit application "spotify"'
echo 'Restarting'
sleep 2s
osascript -e 'tell application "spotify" to play'
else
echo 'All good';
fi
@Saakshaat
Saakshaat / .md
Last active May 25, 2021 15:22
Shell Config and Alises

Since aliases created in terminal are only local to sessions, to make them permanent, you would have to write them in your system's ~/.bashrc file.

Open ~/.bashrc in your editor of choice:

vim ~/.bashrc

Simply write your commands (aliases/scripts) in this file, save [requires root permissions] and exit.

Now that your aliases are in this file, everytime you start a new session, all you'd have to do is load these all scripts/commands in this file using:

@Saakshaat
Saakshaat / idea.md
Last active June 29, 2020 08:24
Terminal Notes

Terminal

Terminal's every developer's best friend; I use mine terminal for almost everything, writing/executing custom scripts, restarting Spotify, opening different IDEs/Editors and what not.

When a new session pops up, my main focus is make minimal efforts and optimise productivity, which, for me is driven by streamlining my priorites and deliverables.

Thus, I had to find a way to combine my terminal and notes/TODOs, and here we are.

Setup