Skip to content

Instantly share code, notes, and snippets.

View abhijit-hota's full-sized avatar
🦕

Abhijit Hota abhijit-hota

🦕
View GitHub Profile
// ==UserScript==
// @name GitHubDocJSONView
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Show link icon in github doc
// @author Abhijit Hota (abhijithota.me)
// @match https://docs.github.com/en/rest/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name NetDiff
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Show net diff in Github PRs
// @author Abhijit Hota (abhijithota.me)
// @match https://github.com/*/*/pull/*
// @grant none
// ==/UserScript==
@abhijit-hota
abhijit-hota / main.go
Created October 24, 2022 06:07
TCP Server & Client
package main
import (
"bufio"
"errors"
"fmt"
"log"
"net"
"os"
"strings"

Keybase proof

I hereby claim:

  • I am abhijit-hota on github.
  • I am kretaceous (https://keybase.io/kretaceous) on keybase.
  • I have a public key ASBac46AhTrj1VqziHIi9jN5F0Bgtd6ru9023MyFfLdVngo

To claim this, I am signing this object:

{
"10": "Bad or missing API token",
"100": "Maintenance",
"300": "Invalid email request",
"400": "Sender Signature not found",
"401": "Sender signature not confirmed",
"402": "Invalid JSON",
"403": "Incompatible JSON",
"405": "Not allowed to send",
"406": "Inactive recipient",
@abhijit-hota
abhijit-hota / test-apis-by-generator-function.js
Last active November 10, 2020 03:49
Using generator functions in JavaScript for error handling
// Use case (?):
// Suppose you have an array of API keys from a service. We all know why you'd have multiple API keys of a single service.
// For some reason, you know that all of them are not gonna work at all times. This is the exact scenario replicated here.
// Dummy array with, let's say, dummy API keys
const api_key_array = [
"vikiohcucbigpinekjodumehdarhagbevrosolhivuvasodumsumvivahpiupaba",
"leluralcotaimgamenfukhajuzkusamubiezilezigiczaduspiwovefniuzaleh",
"wuvoneuvtucesilluleftovarkohlucukjarineetizokujunetejzaanviromdo",
"foccuseucopozecepiogaejegafpellozumoderajewtotlomkigmecaluhindig",
@abhijit-hota
abhijit-hota / youtube-playlist-total-time.js
Last active July 15, 2021 13:18
Output total time of a playlist
/*
Note: This works for URLs like the following:
https://www.youtube.com/playlist?list=PLDV1Zeh2NRsAsbafOroUBnNV8fhZa7P4u
https://www.youtube.com/watch?v=oQQO_n57SB0&list=PLDV1Zeh2NRsAsbafOroUBnNV8fhZa7P4u&index=6
*/
const extra = window.location.pathname === "/watch" ? "panel-" : "";
const tag = `ytd-playlist-${extra}video-renderer`;
const playlistPanel = Array.from(document.getElementsByTagName(tag));
@abhijit-hota
abhijit-hota / Study tool #1 - Hydrocarbons.markdown
Created October 27, 2015 15:30
Study tool #1 - Hydrocarbons

Study tool #1 - Hydrocarbons

I'll make more like this. I didn't make this pen responsive because I'm pretty bad at it. The main concept was to use the 'alkane', 'alkene' and 'alkyne' formula. Hope you alll like it! Please heart

I'll be thankful if anyone would help me making it responsive! :)

A Pen by Abhijit Hota on CodePen.

License.