Skip to content

Instantly share code, notes, and snippets.

View adithya-badidey's full-sized avatar

Adithya Badidey adithya-badidey

View GitHub Profile
@adithya-badidey
adithya-badidey / aggdraw-wrapper.py
Created July 12, 2022 00:02
A simple wrapper for aggdraw utils.
from PIL import Image, ImageDraw
import aggdraw
class Drawing:
def __init__(self, image):
self.d = aggdraw.Draw(image)
self.img_height = image.height
self.img_width = image.width
def transform(self, arr):
@adithya-badidey
adithya-badidey / tester.sh
Created October 30, 2021 16:38
kattis.com Testcase Evaluator for Python
#!/bin/bash
## Directory Structure
# problem-folder/
# ├─ 1.in
# ├─ 1.ans
# ├─ ...
# ├─ main.py <- Your source file
# ├─ tester.sh
@adithya-badidey
adithya-badidey / LiwcUtils.py
Created October 12, 2021 21:02
LiwcUtils class for Python
import liwc
import csv
import numpy as np
import re
import seaborn as sns
def printProgress(message, progress, limit):
output = f"{message} ({progress}/{limit})"
print("\r{: <100}".format(output), end="")
@adithya-badidey
adithya-badidey / tiddlywiki_timediff.js
Last active January 25, 2024 03:31
Macro to return a human readable time difference between given time and now.
/*\
title: $:/adithyab/macros/timediff.js
type: application/javascript
module-type: macro
Macro to return a human readable time difference between present and given times.
If caltime is false, it will ignore the time part of the date and only work on the date.
Date should be passed in JS compatible format "YYYY-MM-DD". With time, the format should be "YYYY-MM-DD H:MM AM/PM"
Visit https://adithyab.in/2020/how-to-make-a-basic-javascript-macro-in-tiddlywiki/
@adithya-badidey
adithya-badidey / hellotiddlywiki.js
Last active July 5, 2020 10:54
A helloworld macro for TiddlyWiki!
/*\
title: $:/adithyab/macros/helloworld.js
type: application/javascript
module-type: macro
A helloworld JS macro for Tiddlywiki!
Visit https://adithyab.in/2020/how-to-make-a-basic-javascript-macro-in-tiddlywiki/
\*/
(function() {