Skip to content

Instantly share code, notes, and snippets.

View TheTrio's full-sized avatar

Shashwat TheTrio

View GitHub Profile
@TheTrio
TheTrio / GSoC23.md
Last active August 22, 2023 15:02
GSoC 23 Report

Final Report - GSoC 2023

It feels like just yesterday that I was writing my proposal for this year's GSoC. I was excited and looking forward to not only working on the codebase again but also interacting with users of the dashboard, something I had never done before. While I always expected to get accepted into the program, I was vastly underestimating how invigorating(and taxing!) user research can get.

And yet here I am, 3 months later. I haven't written a lot of code to be fair but I've come to realize that - at least this year - the code wasn't the most important thing. And so unlike last year's report, you'll find that this report is more about the experience, the things I learned, and the people I talked to rather than about the code I wrote.

So without further ado, let's get started!

Project Details

@TheTrio
TheTrio / kindle_highlights.js
Created March 30, 2023 17:38
A tiny little script to convert Kindle Highlights(saved as "My Clippings.txt" on your Kindle) to JSON
import { createReadStream, writeFileSync } from 'node:fs'
import { createInterface } from 'node:readline'
const [, , fileName] = process.argv
const rl = createInterface({
input: createReadStream(fileName),
crlfDelay: Infinity,
})

(You can find this report on my blog as well)

Final Report - GSoC 2022

All good things must come to an end. And so does my GSoC journey. It's been a great experience contributing and I've learned a lot.

While things had to slow down towards the end(college says Hi!), I'm glad that I was(mostly) able to finish all the work that I had planned.

I've already gone into a lot of detail about the work that I've done in my previous posts, so at the risk of sounding repetitive, I'll just go over the major things that I've done.

@TheTrio
TheTrio / WikEduDashboard JS.md
Last active August 22, 2022 10:58
An overview of the JS side of the Dashboard

JS - Overview

While there is potentially a lot to discuss, I'll try and focus on what I think are the most important issues with our JS side of the stack.

React

Strict Mode

We're using React 17 and the upgrade to 18 would be a bit of a pain if we decide to enable Strict Mode. We don't have it enabled currently and enabling it would require us to(among other things) remove all UNSAFE component methods from our code. This unfortunately is a lot harder to do than it sounds since there isn't a one to one mapping between safe and UNSAFE methods.

@TheTrio
TheTrio / Metaclasses.py
Created July 18, 2022 17:26
A dummy dataclasses like system implemented from scratch using Metaclasses
from typing import Any, Callable
class NoDefault:
...
NO_DEFAULT = NoDefault()
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import random
from dataclasses import dataclass
@dataclass
class Data():
x: list[int]
y: list[int]
@TheTrio
TheTrio / WhatsappWeb.css
Last active February 8, 2023 07:40
A user style to make whatsapp web work on larger displays
/* ==UserStyle==
@name WhatsappWeb
@namespace github.com/openstyles/stylus
@version 1.0.2
@homepageURL https://gist.github.com/TheTrio/8b2f8702dbd8aee04eff7775bfdd1ea6
@updateURL https://gist.githubusercontent.com/TheTrio/8b2f8702dbd8aee04eff7775bfdd1ea6/raw/efce9b7738e63ffc839e4d9aef4087c9910e030a/WhatsappWeb.css
@author Shashwat Khanna
==/UserStyle== */
._1jJ70.two{
#include <iostream>
using namespace std;
const int MAX = 20;
class Stack
{
char str[MAX];
int top;
public:
import random
with open('input.txt') as f:
a = []
arr = map(lambda x: int(x), f.readline().split(' '))
n, t2_, t3_, t4_ = arr
for i in range(n):
arr = f.readline().replace('\n','').split(' ')
del arr[0]
a.append(arr)
@TheTrio
TheTrio / Covid19.py
Last active December 24, 2020 10:45
import requests
from datetime import datetime, timedelta
def WeeklyAverage(countries):
data = requests.get('https://pomber.github.io/covid19/timeseries.json').json()
last_day = datetime.today()
week = timedelta(days=7)
for country in countries: