Skip to content

Instantly share code, notes, and snippets.

View kashifulhaque's full-sized avatar
:shipit:
Hesitation is defeat

Kashif kashifulhaque

:shipit:
Hesitation is defeat
View GitHub Profile
@kashifulhaque
kashifulhaque / NvChad.md
Last active December 3, 2025 13:27
Neovim NvChad keybinds

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 (
@kashifulhaque
kashifulhaque / docker-arch.md
Last active November 8, 2025 17:58
How to install Docker and Docker Compose on Arch Linux

If you do not have yay installed, then follow these steps to install it first

Update

yay

Install

yay -S docker docker-compose
@kashifulhaque
kashifulhaque / uv.md
Last active August 24, 2025 16:55
Some commonly used `uv` commands

Python uv commands

  • uv init dir_name will create a new python project
    • uv init . in an existing project directory
  • uv run script.py will run script.py. No need to activate venv, uv will take care of it
  • uv add lib_name will pull lib_name from pypi and add it to project
  • uv remove lib_name will remove lib_name from the env
  • uv lock will generate a lockfile
  • uv sync will make the venv in sync with lockfile, installing and removing as required
  • uv pip install -r requirements.txt in an existing project directory
@kashifulhaque
kashifulhaque / gpu-compatibility-checker.py
Created November 4, 2024 13:00
GPU Compatibility checker
import torch
import numpy as np
def check_gpu_capabilities():
print("=== GPU Information ===")
if not torch.cuda.is_available():
print("❌ CUDA is not available on this system")
return
@kashifulhaque
kashifulhaque / alacritty.toml
Last active September 22, 2024 10:13
Alacritty config (Windows + WSL)
[shell]
program = "wsl"
args = [ "~" ]
[font]
size = 12
[font.normal]
family = "CodeNewRoman Nerd Font"
style = "Regular"
Aspect On-Policy Off-Policy
Definition Learns the value function for the policy being used for action selection Can learn about a different policy than the one being used for action selection
Policy Updating Uses the same policy for both learning and action selection Can use different policies for learning and action selection
Data Collection Collects data using the current policy Can use data collected from any policy
Exploration Typically requires a balance between exploration and exploitation Can learn from data collected u
@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