Skip to content

Instantly share code, notes, and snippets.

View rahulballal's full-sized avatar

Rahul Ballal rahulballal

View GitHub Profile
@rahulballal
rahulballal / commit_style.md
Created September 5, 2025 04:54
instructions for llms on how to make commits

Conventional Commits Guide for Monorepos

Overview

Conventional Commits is a specification for adding human and machine-readable meaning to commit messages. In a monorepo context, this becomes especially important for tracking changes across multiple packages, services, or applications within a single repository.

Basic Structure

[optional scope]:  [tracker-id]
You are an expert in end-to-end testing with Playwright and JavaScript/TypeScript, working with a React application running locally at http://localhost:3000. Your goal is to generate a complete, runnable Playwright test suite that covers the core user flows of the app.
Requirements:
1. Use Playwright Test in TypeScript.
2. Follow Playwright’s recommended test structure (tests/ directory, test.describe, test.beforeEach, etc.).
3. Assume that the React app runs locally on localhost:3000 when the tests are executed.
4. Write clean, maintainable selectors using getByRole, getByTestId, or semantic HTML attributes (no brittle CSS selectors unless unavoidable).
5. Include tests for:
- Page load and main layout rendering.
- Navigation between key routes/pages.
@rahulballal
rahulballal / spec_gen.go
Created May 23, 2025 10:22
Generate Open API Spec from Huma at build time
package main
import (
"encoding/json"
"os"
"github.com/danielgtaylor/huma/v2"
"github.com/danielgtaylor/huma/v2/adapters/humago"
)
func main() {
@rahulballal
rahulballal / config
Created January 20, 2025 01:12 — forked from adibhanna/config
Ghostty config
font-family = BerkeleyMono Nerd Font
#font-family = Iosevka Nerd Font
# font-family = SFMono Nerd Font
font-size = 20
theme = GruvboxDarkHard
shell-integration-features = no-cursor,sudo,no-title
cursor-style = block
adjust-cell-height = 35%
# background-opacity = 0.96
@rahulballal
rahulballal / app.ts
Created October 18, 2022 11:46
Typesafe Express Shit
import Express from 'express'
import { Application, NextFunction, Request, Response } from 'express'
import y from 'yup'
export interface TypedRequest<TBody> extends Request {
body: TBody
}
export interface TypedResponse<TBody> extends Response {
json: (body: TBody) => Response
}
@rahulballal
rahulballal / Debugging.md
Created June 22, 2022 04:56 — forked from joseluisq/Debugging.md
A simple NodeJS App debugging example in VS Code using Nodemon.

NodeJS debugging in VS Code with Nodemon

A simple NodeJS App debugging example in VS Code using Nodemon.

Note: Feel free to customize .vscode/launch.json and ./nodemon.json files.

Install

yarn add nodemon --dev
@rahulballal
rahulballal / README.md
Created September 21, 2021 13:27 — forked from rduplain/README.md
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini:

@rahulballal
rahulballal / winston-stackdriver.js
Created May 21, 2020 09:00 — forked from jasperkuperus/winston-stackdriver.js
Winston / Stackdriver severity level
const winston = require('winston');
const { LEVEL } = require('triple-beam');
const SeverityLookup = {
'default': 'DEFAULT',
'silly': 'DEFAULT',
'verbose': 'DEBUG',
'debug': 'DEBUG',
'http': 'notice',
'info': 'info',

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@rahulballal
rahulballal / .tmux.conf
Created April 1, 2019 04:34 — forked from gblmarquez/.tmux.conf
.tmux.conf with fish as default shell
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# support logging out and back in
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
# pbcopy support
set-option -g default-command "reattach-to-user-namespace -l bash"
# vi mode