Skip to content

Instantly share code, notes, and snippets.

View 0xDevansh's full-sized avatar

Devansh 0xDevansh

View GitHub Profile
@0xDevansh
0xDevansh / readauthors.py
Created June 23, 2023 15:58
Parsing openlibrary works and authors dump to sqlite database
import json
import sqlite3
import traceback
from contextlib import closing
global init_count
STEP_SIZE = 1000
with open('count_a.txt', 'r') as file:
init_count = 0
count = file.read().rstrip()
@0xDevansh
0xDevansh / Fraction.ts
Created March 18, 2022 14:05
A fraction class in Typescript
import { hcf, lcm } from './utils/hcf-lcm';
export class Fraction {
private _num: number = 0;
private _den: number = 1;
get numerator() {
return this._num;
}
set numerator(value: number) {
@0xDevansh
0xDevansh / eslint-prettier.md
Last active October 29, 2021 15:53
Setting up ESLint Prettier in a Typescript project