Skip to content

Instantly share code, notes, and snippets.

View rhnvrm's full-sized avatar
🔧
Building things

Rohan Verma rhnvrm

🔧
Building things
View GitHub Profile
@rhnvrm
rhnvrm / instq.sh
Created February 9, 2023 11:30
Utility for querying and manipulating Zerodha instruments file
#!/usr/bin/env bash
# instq.sh
# Utility for querying and manipulating Zerodha instruments file
# Usage
# -----
#
# Requirements:
# 1. Install jq
@rhnvrm
rhnvrm / delete_tweets.py
Created August 4, 2021 05:35
Interactively delete tweets from your timeline using tweepy
import tweepy
import os
import logging
import re
def create_api():
consumer_key = os.getenv("CONSUMER_KEY")
consumer_secret = os.getenv("CONSUMER_SECRET")
access_token = os.getenv("ACCESS_TOKEN")
access_token_secret = os.getenv("ACCESS_SECRET")
@rhnvrm
rhnvrm / flatten_test.go
Last active June 9, 2021 12:06
flatten map
package main
import (
"encoding/json"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
@rhnvrm
rhnvrm / coffin_dance.rb
Created May 14, 2020 18:46
Coffin Dance in Sonic Pi
live_loop :beat do
sample :bd_haus, rate: 1
sleep 0.25
sync :melody
end
notes = []
delays = []
notes = [:G4, :G4, :D5, :C5, :As4, :A4, :A4, :C5, :As4, :A4]
@rhnvrm
rhnvrm / bench_expression_engines_test.go
Last active July 24, 2023 12:41
Benchmark Results of govaluate vs cel-go
package main
import (
"fmt"
"testing"
"github.com/Knetic/govaluate"
"github.com/google/cel-go/cel"
"github.com/google/cel-go/checker/decls"
"github.com/google/cel-go/common/types"
@rhnvrm
rhnvrm / README.md
Created January 18, 2019 07:31
Kite Trade CLI Chart Example

image

@rhnvrm
rhnvrm / main.go
Created August 9, 2018 07:08
Tag Spotify Top Tracks with Lyrics
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"github.com/rhnvrm/lyric-api-go"
@rhnvrm
rhnvrm / msgp_lazy_serialization.go
Last active July 24, 2018 12:06
Example of Lazy Serialization using msgp (go generate based MessagePack library) enveloping
package main
import (
"fmt"
"github.com/tinylib/msgp/msgp"
)
//go:generate msgp
@rhnvrm
rhnvrm / benchmark.py
Created July 20, 2018 09:17
Script to Benchmark TimescaleDB Multivalue Inserts
from numpy import random
import logging
import datetime
import os
from functools import reduce
import os
import multiprocessing
import tqdm
@rhnvrm
rhnvrm / check_diffs_status.sh
Last active July 10, 2018 07:56
Conduit (Phabricator API) Check Diff Status Script for use in WTF Terminal Dashboard
echo '{
"authors": [
"PHID-USER-jbsqsep23tcxn5l3ob3y"
],"status":"status-open"
}' | arc call-conduit differential.query | \
python3 -c "import sys, json;
r = json.load(sys.stdin)['response'];
l = [(x['uri'], x['statusName'], x['title']) for x in r];
display = \"{}\t{}\t{}\"
print(\"My Open Diffs:\")