Skip to content

Instantly share code, notes, and snippets.

View hugovk's full-sized avatar

Hugo van Kemenade hugovk

View GitHub Profile
"""
Find the first PEP created after the last PEP created in the 3xxx range.
"""
import datetime as dt
import json
import urllib.request
with urllib.request.urlopen("https://peps.python.org/peps.json") as url:
peps = json.loads(url.read().decode())
@hugovk
hugovk / checklist.md
Last active May 17, 2024 22:38
PyCon US Challenge 2024

https://us.pycon.org/2024/about/pycon-us-challenge/

List of Challenges

1 POINT

  • you see features from Python 3.12+ in presentation slide
  • submit a PR to an open source Python project
  • take a selfie at The PSF booth
  • say thanks to an open source maintainer which project you use
  • give a lightning talk
@hugovk
hugovk / 1000.md
Created May 4, 2023 13:30
Output of `pypinfo --days 7 --limit 1000 numpy version file system`

Served from cache: False Data processed: 3.71 GiB Data billed: 3.71 GiB Estimated cost: $0.02

version file system_name download_count
1.21.6 numpy-1.21.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl Linux 5,544,509
1.24.3 numpy-1.24.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Linux 3,530,114
1.24.3 numpy-1.24.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Linux 2,459,540
@hugovk
hugovk / stives.py
Last active November 28, 2020 22:07
NaNoGenMo 2020: St. Ives
import json
import textwrap
import inflect # python3 -m pip install inflect
def intro():
print(
"""As I was going to St. Ives,
I met a man with seven wives,
@hugovk
hugovk / py_finder.py
Last active February 28, 2020 17:56 — forked from aaltat/py_finder.py
Find files which are not Python 3 compatible
import argparse
import subprocess
import sys
from pathlib import Path
def find_files(src_root: Path, python3: Path):
not_py3_compatible = []
for file in src_root.rglob('*.py'):
import sys
A_LOWERCASE = ord("a")
ALPHABET_SIZE = 26
def _decompose(number):
"""Generate digits from `number` in base alphabet, least significants bits first.
@hugovk
hugovk / nnngm.sh
Created November 21, 2019 21:59
#NNNGM: Another 50,000 Meows: better version
p -c 'import random as r;print(" meow".join([r.choice(",:;.?!") for _ in range(9**5)])[2:])'
@hugovk
hugovk / nnngm.sh
Created November 21, 2019 21:57
#NNNGM: Another 50,000 Meows: basic version
p -c 'print("meow "*9**5)'
@hugovk
hugovk / whatfreshhell.json
Created November 21, 2016 13:30
1. Create a new Twitter bot account 2. Sign in to http://cheapbotsdonequick.com 3. Paste this code in there and away you go! (re: https://twitter.com/Fritinancy/status/800489538254606336)
{
"note:": ["Different number of spaces, to avoid duplicated tweets"],
"origin": [
"What#space#Fresh#space#Hell?"
],
"space": [
" ",
" ",
@hugovk
hugovk / dunebot.json
Created October 6, 2016 08:41
"WLTS a bot like @PotterPapers but for Dune novels." https://twitter.com/Marktech/status/783766409142820864
{
"origin" : [
"#firstNames# of Dune",
"#personalNouns.capitalize.s# of Dune",
"#adjs.capitalize# #venues.capitalize# of Dune"
],
"firstNames" : [
"Aaliyah",
"Aaron",
"Abby",