Skip to content

Instantly share code, notes, and snippets.

View benmuth's full-sized avatar

Ben Muthalaly benmuth

View GitHub Profile
@benmuth
benmuth / scihub-extractor.py
Last active February 13, 2024 20:40
SciHub extractor for ArchiveBox
import argparse
import os
import re
import requests
from w3lib.encoding import html_body_declared_encoding, http_content_type_encoding
from scihub import IdentifierNotFoundError, SciHub
# DOIs taken from https://www.crossref.org/blog/dois-and-matching-regular-expressions/
@benmuth
benmuth / DatabaseServer.go
Last active June 8, 2022 22:40
A database server made for the Recurse Center's pairing interview.
//Before your interview, write a program that runs a server that is accessible on http://localhost:4000/.
//When your server receives a request on http://localhost:4000/set?somekey=somevalue it should store the
//passed key and value in memory. When it receives a request on http://localhost:4000/get?key=somekey it
//should return the value stored at somekey.
//During your interview, you will pair on saving the data to a file. You can start with simply appending
//each write to the file, and work on making it more efficient if you have time.
package main
@benmuth
benmuth / wordle.go
Last active April 7, 2022 06:09
Wordlebot: a bot using a command line interface that attempts to solve Wordle puzzles. Inspired by "Solving Wordle using Information theory" (https://youtu.be/v68zYyaEmEA).
package main
import (
"github.com/Wussell/wordlebot"
"fmt"
"log"
"strconv"
"strings"
)
//eval evaluates the performance of wordlebot, tells you what words it failed to guess in a given word list, and returns the average score.