Skip to content

Instantly share code, notes, and snippets.

View GokulNC's full-sized avatar
👻

Gokul NC GokulNC

👻
View GitHub Profile
@GokulNC
GokulNC / thinkific_quiz_render_patches.html
Last active March 5, 2024 16:57
Thinkific Footer code to enable LaTeX rendering (using KaTeX) and Code Syntax Highlighting (using Highlight.js) on Quiz Sections
<!-- PATCH TO ENABLE KATEX & HIGHLIGHT.JS FOR THINKIFIC QUIZ SECTIONS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.0/dist/katex.min.css" integrity="sha384-t5CR+zwDAROtph0PXGte6ia8heboACF9R5l/DiY+WZ3P2lxNgvJkQk5n7GPvLMYw" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.13.0/dist/katex.min.js" integrity="sha384-FaFLTlohFghEIZkw6VGwmf9ISTubWAVYW8tG8+w2LAIftJEULZABrF9PPFv+tVkH" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.13.0/dist/contrib/auto-render.min.js" integrity="sha384-bHBqxz8fokvgoJ/sc17HODNxa42TlaEhB+w8ZJXTc2nZf1VgEaFZeZvT4Mznfz0v" crossorigin="anonymous"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/dracula.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js"></script>
<script>
/* For my usage with the "Custom JavaScript for Websites 2" extension,
to jump across trial-based paywalls of certain websites like nautil.us or medium.com */
// Delete all cookies (Src: https://stackoverflow.com/a/33366171 )
(function () {
var cookies = document.cookie.split("; ");
for (var c = 0; c < cookies.length; c++) {
var d = window.location.hostname.split(".");
while (d.length > 0) {
var cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path=';
@GokulNC
GokulNC / LibriSpeech_Annotator.md
Last active June 25, 2020 05:41
LibriSpeech Annotation Corrector

Steps:

  1. Place this script inside your librispeech dataset folder.
  2. This should the directory structure of the dataset folder:
libri_dataset
|-libri_annotator.py
|-txt
 |- sample1.txt
 |- sample2.txt
@GokulNC
GokulNC / adb_rm_package.py
Created June 1, 2020 11:11
A script to uninstall a given Android package-name. If it's a system app, it will be force-disabled.
import sys
from subprocess import Popen, PIPE, STDOUT
def run_command(command):
out = Popen(command.split(), shell=True, stdout=PIPE, stderr=STDOUT)
stdout, stderr = out.communicate()
return stdout.decode("utf-8").strip()
def remove_package_adb(pkg_name, disable=True):
out = run_command('adb uninstall %s' % pkg_name)
@GokulNC
GokulNC / mypustak_search.py
Created June 1, 2020 11:07
A script I wrote to search MyPustak for books
import json
import requests
import sys
from tabulate import tabulate
USAGE = 'python %s <search_query> <num_pages>' % sys.argv[0]
POST_URL = 'https://data.mypustak.com//search/get/SearchBooksCollection/%s/%d'
payload = {"query_by": "title,author,publication,isbn", "stock_filter_by":["N"], "bookType_filter_by":[0]}
def get_book_list(response):
@GokulNC
GokulNC / wiki_dump_size.py
Last active May 30, 2020 14:18
Basic script to find old Wikipedia XML dump sizes and number of words/tokens in them
# Basically I was trying to find out the size of MBERT model's data for Indian languages
# Date based on: https://github.com/google-research/bert/blob/f18bd94b8fee9bda3c293e0932d100add35b780c/multilingual.md
import requests
from bs4 import BeautifulSoup
from time import sleep
ARCHIVE_API = 'http://web.archive.org/cdx/search/cdx?url=%s&output=json'
WIKIDUMP_URL = 'https://dumps.wikimedia.org/%swiki/%s'
ARCHIVE_URL = 'http://web.archive.org/web/%s/%s'
@GokulNC
GokulNC / Bee Movie Plot Spammer.md
Last active September 9, 2023 18:15
Bee Movie Plot Spammer
@GokulNC
GokulNC / Remote_FS_Mount.bat
Last active September 8, 2019 05:49
Mounts remote SSH machine's file system on local machine using SSH-FS
@echo off
:: OpenSSH Private Key File
set KEY_PATH=C:\\Users\\GokulNC\\Desktop\\Keys\\GCP_VM\\id_rsa
set USERNAME=GokulNC_GCP
set REMOTE_DIR=/
set /p IP=Enter the IP:
set /p DriveLetter=Enter the mount drive letter: