Skip to content

Instantly share code, notes, and snippets.

#
# Python script to create USA flag using turtle.
# Author - https://www.pythoncircle.com
# Original Author - https://www.codesters.com/preview/6fe8df0ccc45b1460ab24e5553497c5684987fb5/
import turtle
import time
from PIL import Image
import math
@cavedave
cavedave / dictionary_turkey_quoted2.txt
Last active April 24, 2025 16:16
Turkey in European languages
abk grey
sqi sea rooster pink
ara bibi tan
hye grey
de-at yellow
eus indian yellow
bel indian yellow
bos ćùrān tan
bre lightblue
bul swanky bird blue
@cavedave
cavedave / bat_etymology_dataset.csv
Last active April 22, 2025 18:15
Bats have crazy words for them in languages I started with this https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2Fapnha37a0fk51.jpg from a university. and added some more languages. Code is a copy of https://github.com/cainesap/mapMakeR/tree/master/etymologyMaps updated for new python
lang iso word translation meaning_group color source
Spanish spa murciélago little blind mouse blind_mouse lightblue https://en.wiktionary.org/wiki/murciélago
Portuguese por morcego little blind mouse blind_mouse lightblue https://en.wiktionary.org/wiki/morcego
Catalan cat ratpenat winged rat winged_rat yellow https://en.wiktionary.org/wiki/ratpenat
Galician glg morcego little blind mouse blind_mouse lightblue https://en.wiktionary.org/wiki/morcego#Galician
Basque eus saguzar old mouse old_mouse skyblue https://en.wiktionary.org/wiki/saguzar
French fra chauve-souris bald mouse bald_mouse skyblue https://en.wiktionary.org/wiki/chauve-souris
Italian ita pipistrello evening creature evening_creature orange https://en.wiktionary.org/wiki/pipistrello
Romansh roh utschè mezmiur unknown grey https://en.wiktionary.org/wiki/utschè_mezmiur
German deu Fledermaus flutter mouse flutter_mouse lemonchiffon https://en.wiktionary.org/wiki/Fledermaus
@cavedave
cavedave / football.ipynb
Created February 23, 2025 13:43
Football.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / eggs.py
Created February 12, 2025 11:41
usa egg prices
import requests
import pandas as pd
def download_data(url, filename):
"""Downloads data from a given URL and saves it as a CSV file.
Args:
url: The URL of the data to download.
filename: The name of the CSV file to save the data to.
@cavedave
cavedave / walks.ipynb
Last active February 23, 2025 13:53
walks.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / ukincome.ipynb
Last active January 29, 2025 13:35
ukincome.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / dictionary_bat.txt
Last active December 28, 2023 18:03
MAke map of etymology of the word bat in european languages. Code from Most names gotten from here https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2Fapnha37a0fk51.jpg Some gotten from wiktionary https://en.wiktionary.org/wiki/yarasa code a slightly modified version of https://github.com/dd52/mapMakeR/tree/master/etymologyMaps I am sure …
abk, ?, grey
ara, day blind, lightyellow
aze, night bird, orange
bel, leather one, turquoise
bos, blind mouse, lightgreen
bre, blind mouse, lightblue
bul, sticking one, blue
cat, winged rat, yellow
cau, ?, grey
ces, night flyer, lightgreen
@cavedave
cavedave / heapslaw.py
Created October 21, 2023 18:35
heaps law graph to draw
import matplotlib.pyplot as plt
unique = []
check = []
k = 50 #These need to be estimated for particular languages but this is a base estimate
b=0.4 #
for x in range(1, 100000, 100):
unique.append(k*(x**b))
check.append(x)
@cavedave
cavedave / parseCroidhePdf.py
Created August 12, 2023 16:39
Code to parse a pdf of the only Irish-Irish dictionary of the 20th century. Croidhe Cainnte Chiarraighe. Foclóir Gaeilge-Gaeilge (pdf) 1942. PDF is at https://www.forasnagaeilge.ie/wp-content/uploads/2016/06/8fddae92ae307b022d964ebe73d45df6.pdf . I took a few pages using https://smallpdf.com/split-pdf to speed up experiments but that can be done…
import pdfplumber
def is_bold_font(char):
return "bold" in char['fontname'].lower()
def parse_pdf_to_dictionary(pdf_path):
term_definition_dict = {}
term = ""
next_term = ""
definition = ""