Skip to content

Instantly share code, notes, and snippets.

View guptarohit's full-sized avatar
Focusing; 1.01³⁶⁵

Rohit Gupta guptarohit

Focusing; 1.01³⁶⁵
View GitHub Profile
linkdd / hackernews-new-comms.js
Last active September 20, 2021 22:52
Add a bell emoji to unread comments on HackerNews
View hackernews-new-comms.js
// Can be used with
// This snippet is released under the terms of the CC0 license:
const cache_key = 'hn_comments_views'
const cache = JSON.parse(localStorage.getItem(cache_key) || '{}')
document.querySelectorAll('.athing.comtr').forEach(comm => {
if (!cache[]) {
const span = document.createElement('span')
span.innerHTML = '🔔' // :bell: emoji
trumad /
Last active September 11, 2023 12:10
See multiple tradingview windows side by side, hopefully without ads and popups.
# First install webview:
# pip install pywebview
# Then create a config.json file in the same folder with the following options:
ih2502mk /
Last active December 2, 2023 16:13
Quantopian Lectures Saved
View history.txt
I was drawn to programming, science, technology and science fiction
ever since I was a little kid. I can't say it's because I wanted to
make the world a better place. Not really. I was simply drawn to it
because I was drawn to it. Writing programs was fun. Figuring out how
nature works was fascinating. Science fiction felt like a grand
Then I started a software company and poured every ounce of energy
into it. It failed. That hurt, but that part is ok. I made a lot of
mistakes and learned from them. This experience made me much, much
fnky /
Last active December 2, 2023 13:08
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
$ cat
from pprint import pprint
from pytheory import Tone, Fretboard, charts_for_fretboard

tones = (


1hakr /
Last active November 29, 2023 20:04
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
lucasjellema / docker-compose.yml
Created May 22, 2018 04:57
Docker Compose file for Apache Kafka, the Confluent Platform (4.1.0) - with Kafka Connect, Kafka Manager, Schema Registry and KSQL (1.0) - assuming a Docker Host accessible at
View docker-compose.yml
version: '2'
image: "confluentinc/cp-zookeeper:4.1.0"
hostname: zookeeper
- "2181:2181"
import cv2
import time
person_cascade = cv2.CascadeClassifier(
cap = cv2.VideoCapture("/path/to/test/video")
while True:
r, frame =
if r:
start_time = time.time()
import concurrent.futures
import functools
import operator
import time
from pprint import pprint
TEXT = """Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis.
Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris