Skip to content

Instantly share code, notes, and snippets.

View kashifulhaque's full-sized avatar
🤞
Infinite Void

Kashif kashifulhaque

🤞
Infinite Void
View GitHub Profile
@kashifulhaque
kashifulhaque / alacritty.toml
Created June 26, 2024 15:15
Alacritty config (Windows + WSL)
[shell]
program = "wsl"
args = [ "~" ]
[font]
size = 12
[font.normal]
family = "CodeNewRoman Nerd Font"
style = "Regular"
@kashifulhaque
kashifulhaque / Distances.md
Created June 18, 2024 17:22
Some commonly used distance metrics in ML

In order to check similarity between 2 vectors, we can check the distance between them. There are a few different metrics to measure distance between 2 vectors.

import numpy as np

1. Cosine similarity

Measures the angle between 2 non-zero vectors. It ranges between $[-1, 1]$ $$cos (\theta) = \frac{\vec{p} \cdot \vec{q}}{||p|| \text{ } ||q||}$$

def cosine_similarity(p, q):
@kashifulhaque
kashifulhaque / NixOS-Unstable.md
Created April 13, 2024 10:07
To enable "unstable" branch in NixOS

Add the unstable NixOS channel

sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable

Update the unstable NixOS channel

sudo nix-channel --update nixos-unstable
@kashifulhaque
kashifulhaque / Bash-Hotkeys.md
Created February 13, 2024 18:29
Bash hotkeys
  • Ctrl + X kill active process
  • Ctrl + D exit active shell
  • Ctrl + L clear screen
  • Ctrl + Z put current process in background (fg to bring it back to foregorund)
  • Ctrl + A to go to front of a line
  • Ctrl + E to go the end of a line
  • Ctrl + F to go forward one character (right arrow)
  • Ctrl + B to go backward one character (left arrow)
  • Alt + F to go forward one word (vim w motion)
  • Alt + B to go backward one word (vim b motion)
@kashifulhaque
kashifulhaque / conda.md
Created January 17, 2024 11:16
Conda environment

To export and share your conda environment

conda activate your_env_name
conda env export > environment.yml

To import environment from YAML file

@kashifulhaque
kashifulhaque / decompress.sh
Created January 5, 2024 20:38
To decompress the tar file
#!/bin/bash
tar --use-compress-program=pigz -xvf archlinux_kde_${TIMESTAMP}.tar.gz
@kashifulhaque
kashifulhaque / compress.sh
Created January 5, 2024 20:34
Compress the config files (Arch + KDE setup)
#!/bin/bash
echo "A simple script compress my dotfiles"
echo "------------------------------------"
# Check if 'pigz' is installed or not
command_exists() {
command -v "$1" >/dev/null 2>&1
}
@kashifulhaque
kashifulhaque / OhMyPosh_Environment.json
Created December 29, 2023 18:23
Show Python Environment in Oh My Posh
{
"background": "#181818",
"foreground": "p:white",
"style": "powerline",
"properties": {
"display_mode": "environment",
"fetch_virtual_env": true,
"home_enabled": true
},
"type": "python",
@kashifulhaque
kashifulhaque / NvChad.md
Last active June 30, 2024 08:24
Neovim stuff with NvChad

Neovim keybinds

  • Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
  • _ (underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
    • 0 (zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
  • $ (dollar) to move the cursor at the end of line (doesn't switch to insert mode)
  • d$ will delete from wherever your cursor is till the end of the line
  • f<character> to move cursor to the first occurrence of <character>
    • f( to move cursor to first occurence of (
  • t<character> to move cursor to upto but not on the first occurrence of <character>
  • t( to move cursor to first occurence of (