Skip to content

Instantly share code, notes, and snippets.

View rahulballal's full-sized avatar

Rahul Ballal rahulballal

View GitHub Profile
@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
brew bundle dump
brew bundle --force cleanup
@rahulballal
rahulballal / settings.json
Created October 20, 2018 13:14
my vscode settings
{
"workbench.iconTheme": "eq-material-theme-icons",
"workbench.activityBar.visible": true,
"workbench.editor.enablePreview": false,
"workbench.settings.editor": "json",
"workbench.colorTheme": "Material Theme High Contrast",
"editor.fontFamily": "Inconsolata",
"editor.minimap.enabled": false,
"editor.formatOnSave": false,
"editor.tabSize": 2,
@rahulballal
rahulballal / asyncwaitonly.js
Created February 27, 2018 11:17
accumulator using async/await
// {
// "data": [],
// "page": 1000,
// "per_page": 3,
// "total": 12,
// "total_pages": 4
// }
// http get https://reqres.in/api/users\?page\=1000