Skip to content

Instantly share code, notes, and snippets.

View amitness's full-sized avatar
⬆️
1.01³⁶⁵

Amit Chaudhary amitness

⬆️
1.01³⁶⁵
View GitHub Profile
@pmallory
pmallory / WikipediaCrawl.py
Last active May 10, 2022 00:38
Crawl Wikipedia, starting from a random article. Click the first link in each article and see where we wind up! spoiler alert: probably at the Philosophy article
import time
import urllib
import bs4
import requests
start_url = "https://en.wikipedia.org/wiki/Special:Random"
target_url = "https://en.wikipedia.org/wiki/Philosophy"
@matthen
matthen / hello_world.py
Last active July 1, 2024 05:08
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List