Skip to content

Instantly share code, notes, and snippets.

# Set default text editor
export EDITOR=vim
export VISUAL=vim
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.zsh_history
# Vi mode bindings
bindkey -v
@diwasblack
diwasblack / tmux.conf
Last active October 15, 2025 16:23
Config file for tmux
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# Support mouse
set -g mouse on
# Short command delay
set -sg escape-time 1
# Set the numbering of windows to go from 1
@diwasblack
diwasblack / text_analysis.md
Last active September 29, 2025 16:39
A prompt based text analyzer made using Gemini.

Example 1: English Language

example_text = """In a controversial effort to eliminate the "unsportsmanlike art of the lob," the Global Tennis Federation (GTF) 
today launched a bizarre new rule, immediately deploying robotic, six-foot-tall, transparent barriersdubbed 
'Net-Guards'to hover above the center of the net on every court worldwide.

During the rule's chaotic debut at the Paris Open, several matches were immediately forfeited after players
reflexively struck the 'Net-Guard.'
@diwasblack
diwasblack / emulator.md
Created September 28, 2025 21:21
Android Virtual Device without Android Studio

Android Virtual Device without Android Studio

Guide for configuring Android Virtual Device(AVD) on macOS using command line.

Start with Homebrew installation if you do not have that installed.

Installation

First, make sure that openjdk is installed. If not, install most recent

@diwasblack
diwasblack / immich.md
Last active September 28, 2025 21:24
Tips for setting up Immich

Setup Remote Access for Immich

  • Setup Immich using quickstart guide.
  • Forward port to the docker address as follows. netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=2283 connectaddress=172.24.9.45 connectport=2283
  • For local network connections, allow incoming connection to port 2283
  • And, for remote connection use Tailscale to forward traffic to Immich server.
@diwasblack
diwasblack / fake_document_detection.md
Last active September 29, 2025 03:39
Identify fake document by using Gemini API
# Load an example image
image_url = "https://dpsnews.utah.gov/wp-content/uploads/sites/37/2021/06/UT_D200_H_DL_Front_PF.jpg"
image_bytes = requests.get(image_url).content
image = types.Part.from_bytes(
    data=image_bytes, mime_type="image/jpeg"
)

response = classify_image(image)
@diwasblack
diwasblack / nn.py
Last active September 28, 2025 21:26
Backpropagation Neural Network implementation using numpy
import copy
import logging
import numpy as np
import matplotlib.pyplot as plt
logging.basicConfig(
format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)