Skip to content

Instantly share code, notes, and snippets.

View kshitij10496's full-sized avatar

Kshitij Saraogi kshitij10496

View GitHub Profile
@kshitij10496
kshitij10496 / settings.json
Created May 14, 2025 15:00
zed configuration
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"vim_mode": false,
@kshitij10496
kshitij10496 / zshrc
Created May 14, 2025 13:50
zsh configuration
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time Oh My Zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# Increase the default font size.
font-size = 18
# Allow CMD + Backspace to delete the current line buffer (like Warp).
keybind = cmd+backspace=esc:w
# ZSH Shell
shell-integration = zsh
# Theme
@kshitij10496
kshitij10496 / ergast.sql
Created December 6, 2021 15:54
SQL commands to create DB tables on PostgreSQL
CREATE TABLE circuits(
circuitId INTEGER NOT NULL PRIMARY KEY,
circuitRef VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
location VARCHAR(255) DEFAULT NULL,
country VARCHAR(255) DEFAULT NULL,
lat NUMERIC(8,5) DEFAULT NULL,
lng NUMERIC(10,6) DEFAULT NULL,
alt INTEGER DEFAULT NULL,
url VARCHAR(255) NOT NULL UNIQUE
@kshitij10496
kshitij10496 / pg_random_integer.sql
Created May 28, 2021 15:27
[Postgres] Helper function to generate random integer in a range
-- Helper function to generate random integer in a range.
-- Extremely useful for generating mock data for testing.
CREATE OR REPLACE FUNCTION RANDOM_BETWEEN(low INT ,high INT)
RETURNS INT AS
$$
BEGIN
RETURN floor(random()* (high-low + 1) + low);
END;
$$ language 'plpgsql' STRICT;
@kshitij10496
kshitij10496 / Makefile
Last active March 25, 2021 15:00
Minimalistic help recipe for Makefiles
.PHONY: help
help: ## Show this help.
@echo "Targets:"
@grep -E '^[a-zA-Z\/_-]*:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\t%-20s: %s\n", $$1, $$2}'
@kshitij10496
kshitij10496 / diffy_traffic.sh
Created July 11, 2019 08:17
Bash Script for sending traffic to diffy instance for the example Docker image.
#!/usr/bin/env bash
echo "Send some traffic to your Diffy instance"
declare -a endpoints=("success" "noise" "regression" "noisy_regression")
declare -a values=("mixpanel" "twitter" "airbnb" "paytm" "baidu")
for i in {1..10}
do
for k in "${endpoints[@]}"
do
for v in "${values[@]}"
do
@kshitij10496
kshitij10496 / pvp.py
Created April 26, 2019 18:40
Jena's MTP Code
import numpy as np
import matplotlib.pyplot as plt
def plot(x, y, deg, well):
'''
x, y are the inputs (porosity and permeability) respectively.
deg = degree of the ploynomial best-fit curve.
well = name of the well.
'''
z = np.polyfit(x, y, deg)
@kshitij10496
kshitij10496 / build.sh
Created January 26, 2019 12:57 — forked from isacikgoz/build.sh
Simple bash script for cross-compiling Go code for release
#!/bin/bash
#
APP_VER="0.3"
BUILD_ARCH_AMD64="amd64"
BUILD_ARCH_ARM64="arm64"
BUILD_ARCH_ARM="arm"
BUILD_ARCH_x86="386"
@kshitij10496
kshitij10496 / docker-compose.yml
Created January 17, 2019 16:15
[Postgres with Docker]: Data Persistence
version: '3'
services:
postgres:
image: postgres:11.1-alpine
container_name: shadowsDB
environment:
POSTGRES_DB: "league_of_shadows"
POSTGRES_USER: "batman"
POSTGRES_PASSWORD: "blueflower"