Skip to content

Instantly share code, notes, and snippets.

View guptarohit's full-sized avatar
🎯
Focusing

Rohit Gupta guptarohit

🎯
Focusing
View GitHub Profile
@adtac
adtac / Dockerfile
Last active November 1, 2024 03:05
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@Adrian-2105
Adrian-2105 / autoinstall_custom_zsh_ubuntu.sh
Last active November 27, 2024 10:26
Script to auto-install my ZSH basic settings
#!/bin/bash
ZSH_CONFIG=~/.zshrc
PLUGINS=~/.local/zsh_plugins
if [[ $EUID -eq 0 ]]; then
echo "This script must not be executed using sudo directly. Exiting..."
exit 1
fi
@linkdd
linkdd / hackernews-new-comms.js
Last active August 25, 2024 11:15
Add a bell emoji to unread comments on HackerNews
// Can be used with https://github.com/xcv58/Custom-JavaScript-for-Websites-2
// This snippet is released under the terms of the CC0 license: https://creativecommons.org/publicdomain/zero/1.0/deed.en
const cache_key = 'hn_comments_views'
const cache = JSON.parse(localStorage.getItem(cache_key) || '{}')
document.querySelectorAll('.athing.comtr').forEach(comm => {
if (!cache[comm.id]) {
const span = document.createElement('span')
span.innerHTML = '🔔' // :bell: emoji
@kepano
kepano / obsidian-web-clipper.js
Last active December 6, 2024 13:34
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@davidteren
davidteren / nerd_fonts.md
Last active December 11, 2024 19:35
Install Nerd Fonts via Homebrew [updated & fixed]
@trumad
trumad / tradingViewMultipleWindows.py
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:
"""
{
"content":[
{
"exchange":"Bitstamp",
"ticker":"BTCUSD",
@ih2502mk
ih2502mk / list.md
Last active December 13, 2024 19:25
Quantopian Lectures Saved
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
adventure.
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
fnky / ANSI.md
Last active December 14, 2024 06:50
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

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


tones = (
    Tone.from_string("F2"),
    Tone.from_string("C3"),
    Tone.from_string("G3"),

Tone.from_string("D4"),