Skip to content

Instantly share code, notes, and snippets.

View thehappycheese's full-sized avatar

thehappycheese

  • Western Australia
View GitHub Profile
@thehappycheese
thehappycheese / ..Python Package Boilerplate.md
Last active September 14, 2022 01:52
Python Package Boilerplate

I like to use the following folder structure

NicksPythonPackage/
├─ src/
│  ├─ examplepythonpackage/
│  │  ├─ __init__.py
│  │  ├─ some_module.py
│  │  ├─ some_sub_package/
│ │ │ ├─ __init__.py
@thehappycheese
thehappycheese / python_version_used_by_terminal.ipynb
Last active February 24, 2022 07:41
Confirm the active python version in your jupyter notebook (the version used by ! terminal cell magics)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thehappycheese
thehappycheese / file_structure.md
Last active February 13, 2025 01:01
Rust folder structure / file structure import example

I love ❤️ rust but I hate 😞 how vague the beginner documentation is about splitting up your project into a practical structure. This is how I do it (for a library project anyway):

.
└── project/
    ├── src/
    │   ├── lib.rs
    │   ├── top_level_module.rs
    │   └── util/
@thehappycheese
thehappycheese / get_faster.py
Last active November 20, 2023 03:10
GET faster in python. Maps a pandas Series of URL strings to data returned from the web using urllib3
import pandas as pd
import concurrent.futures
import urllib3
def _load_url(arg):
url, http = arg
response = http.request("GET", url)
if response.status!=200:
return f"ERROR: {response.status}"
return response.data.decode("utf8")