Skip to content

Instantly share code, notes, and snippets.

View BharatKalluri's full-sized avatar
🎯
Focusing

Bharat Kalluri BharatKalluri

🎯
Focusing
View GitHub Profile
#!/usr/bin/env node
import "source-map-support/register";
import * as cdk from "aws-cdk-lib";
import {Construct} from "constructs";
import {IpProtocol, SubnetType} from "aws-cdk-lib/aws-ec2";
const envDetails = {account: "<accountId>", region: "ap-south-1"};
const vpcName = 'uat-vpc'
export class NetworkStack extends cdk.Stack {
@BharatKalluri
BharatKalluri / gen.py
Last active December 7, 2023 11:56
generate tests from har
import itertools
import json
import os.path
import sys
from urllib.parse import urlparse
from haralyzer import HarParser, HarPage, HarEntry
def filter_fn(entry: HarEntry):
@BharatKalluri
BharatKalluri / README.md
Last active September 18, 2023 15:52
Norns: A TODO wrangler for TODOs across git repositories

Build the database

build_todo_db . >> ~/tododb.json

this creates a file with all the TODOs along with its metadata at ~/tododb.json

@BharatKalluri
BharatKalluri / zostel.py
Created January 22, 2023 17:05
Find all available dorms across zostels in a time range
import requests
# find these from avalibility get request for your session
TOKEN = "Bearer "
CLIENT_APP_ID = ""
CLIENT_USER_ID = ""
# input dates here
check_in = "2023-01-25"
check_out = "2023-01-29"
@BharatKalluri
BharatKalluri / blockchain.ipynb
Last active November 9, 2022 06:02
An simple implementation of blockchain using python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BharatKalluri
BharatKalluri / config.py
Created August 11, 2022 10:09
HDFC bank statement importer for Beancount
import sys
from typing import List
from beancount.core.number import D
from beancount.ingest import importer
from beancount.core import amount, flags
from beancount.core.data import Posting, Transaction, new_metadata
from smart_importer import apply_hooks
from smart_importer.detector import DuplicateDetector
@BharatKalluri
BharatKalluri / cal_parser.py
Last active January 29, 2022 14:40
Meeting stats from calendar
import datetime
from datetime import timedelta
from functools import reduce
from typing import TextIO
import icalendar
ical_contents_raw: TextIO = open('/Users/bharatkalluri/Downloads/bharat@refyne.co.in.ics', 'r')
ical_contents: str = ical_contents_raw.read()
work_cal = icalendar.Calendar.from_ical(ical_contents)
@BharatKalluri
BharatKalluri / mv_and_rename_shots_hash.py
Last active March 22, 2022 13:49
Renames files with their hash for picture management
#!/usr/bin/env python3
import hashlib
import logging
import os.path
import shutil
import sys
from pathlib import Path
from typing import List
@BharatKalluri
BharatKalluri / vala-101.vala
Last active December 29, 2021 18:42
Vala 101
class Vala.Basics : GLib.Object {
public static void post_request() {
var soupSession = new Soup.Session ();
var soupMessage = new Soup.Message("POST", "https://reqres.in/api/users");
var body = "{\"name\":\"morpheus\"}";
soupMessage.set_request(
"application/json",
Soup.MemoryUse.COPY,
body.data
@BharatKalluri
BharatKalluri / auto_mute_spotify_profile.sh
Last active February 5, 2022 19:02
Snippets on medium
# .profile
# Mute spotify on ad
while sleep 1; do mute_ad_spotify; done &