Skip to content

Instantly share code, notes, and snippets.

View arnav-t's full-sized avatar
📊
Alt SysRq F

Arnav Tiwari arnav-t

📊
Alt SysRq F
View GitHub Profile
@arnav-t
arnav-t / process.sh
Created September 16, 2021 20:38
Batch MHTML to HTML conversion
#!/bin/bash
# Get the main HTML file name (has no extension yet)
get_main_file_name() {
# Gets stuff trailing after / from line
grep -m1 "Content-Location: " $1 | rev | cut -f 1 -d/ | rev | tr -d $'\r\n'
}
# Fix header of the file
fix_header() {
@arnav-t
arnav-t / cf-tex-inversion.js
Created September 16, 2021 05:42
CF DarkReader Tex Formulae Inversion
// ==UserScript==
// @name CF DarkReader invert Tex Formulae
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://codeforces.com/*
// @icon https://www.google.com/s2/favicons?domain=codeforces.com
// @grant none
// ==/UserScript==
@arnav-t
arnav-t / blur-cf.js
Created September 8, 2021 14:38
Blur Codeforces tags
// ==UserScript==
// @name Codeforces Hide Problemset Tags
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide tags unless hovered over
// @author arnav-t
// @match https://codeforces.com/problemset*
// @icon https://www.google.com/s2/favicons?domain=codeforces.com
// @grant none
// ==/UserScript==
@arnav-t
arnav-t / results-autofill.js
Created April 28, 2021 18:50
Autofill results page and solve captcha
// ==UserScript==
// @name ERP Results Autofill
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Make ERP less annoying to use
// @author You
// @match https://erp.iitkgp.ac.in/StudentPerformanceV2/auth/*
// @icon https://www.google.com/s2/favicons?domain=ac.in
// @grant GM_xmlhttpRequest
// @run-at document-idle
@arnav-t
arnav-t / app.py
Created April 21, 2021 15:09
Modified app.py to work with Medium Local Run
from flask import Flask, send_from_directory, request, jsonify, redirect
from flask_restful import Resource, Api, reqparse
import os
import subprocess
import time
import json
from datetime import datetime
from flask_swagger import swagger
from flask_swagger_ui import get_swaggerui_blueprint
from flask_autoindex import AutoIndex
@arnav-t
arnav-t / verify_config.py
Created April 15, 2021 14:31
provider_config.json verification script
#!/usr/bin/python3
from json import load
from os import path, chdir
from sys import argv
class ConfigVerifier():
def __init__(self, config_file = 'provider_config.json', verbose = True):
"""Verify provider_config.json file
{
"workbench.colorTheme": "Dracula Soft",
"c-cpp-compile-run.cpp-flags": "-Wall -Wextra -std=c++14",
"pddlParser.executableOrService": "c:\\Users\\Arnav\\AppData\\Roaming\\Code\\User\\globalStorage\\jan-dolejsi.pddl\\val\\Val-20200617.2-win64\\bin\\Parser.exe",
"pddl.validatorPath": "c:\\Users\\Arnav\\AppData\\Roaming\\Code\\User\\globalStorage\\jan-dolejsi.pddl\\val\\Val-20200617.2-win64\\bin\\Validate.exe",
"pddl.valueSeqPath": "c:\\Users\\Arnav\\AppData\\Roaming\\Code\\User\\globalStorage\\jan-dolejsi.pddl\\val\\Val-20200617.2-win64\\bin\\ValueSeq.exe",
"pddl.valStepPath": "c:\\Users\\Arnav\\AppData\\Roaming\\Code\\User\\globalStorage\\jan-dolejsi.pddl\\val\\Val-20200617.2-win64\\bin\\ValStep.exe",
"git.ignoreMissingGitWarning": true,
"python.defaultInterpreterPath": "C:\\Users\\Arnav\\AppData\\Local\\Programs\\Python\\Python36-32\\python.exe",
"[typescriptreact]": {
@arnav-t
arnav-t / autoteams.js
Last active January 30, 2021 09:13
AutoTeams.js - Tampermonkey/Greasemonkey script for autojoining meetings
// ==UserScript==
// @name AutoTeams
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Auto Join MS Teams meetings
// @author arnav-t
// @match https://teams.microsoft.com/*
// @grant none
// ==/UserScript==
@arnav-t
arnav-t / zimbra-export.js
Last active December 29, 2020 23:25
Export Zimbra contact search results in JSON
class Zimbra {
constructor(verbose = true) {
this.verbose = verbose;
this.collection = [];
this.watch = this.watch.bind(this);
this.extract = this.extract.bind(this);
this.extractPage = this.extractPage.bind(this);
this.dump = this.dump.bind(this);
this.unwatch = this.unwatch.bind(this);
}
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"