Skip to content

Instantly share code, notes, and snippets.

View clamytoe's full-sized avatar
💭
Striving to learn something new each day.

Martin Uribe clamytoe

💭
Striving to learn something new each day.
View GitHub Profile
@clamytoe
clamytoe / env_export.zsh
Created May 23, 2025 12:59
Script to export current Conda environment into a environment.yml from install history but also includes any pip installed packages.
#!/usr/bin/zsh
# Export the Conda environment with only explicitly installed packages
conda env export --from-history > environment.yml
# Remove the 'prefix:' line from the exported file for portability
sed -i 's/prefix:.*//' environment.yml
# Append the pip packages section from a full environment export (without build info)
conda env export --no-builds | awk '/^ - pip:/,/^$/ {print}' >> environment.yml
@clamytoe
clamytoe / fuel_tracker.py
Last active May 23, 2025 12:51
Script for tracking fuel usage and efficiency. I use this on my iPhone within Pythonista so it's convenient to use right at after filling up.
import csv
from datetime import datetime
from typing import Optional
STARTING_ODOMETER_READING = 188590
LOG_FILE = "fuel_log.csv"
def log_fuel_efficiency(
current_miles: int,
@clamytoe
clamytoe / kaggle.yml
Last active November 14, 2024 15:09
Conda Kaggle notebook environment.
name: kaggle
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
- aiohttp=3.9.5
- aiosignal=1.3.1
- anyio=4.4.0
@clamytoe
clamytoe / cera_vid_extract.py
Last active July 9, 2022 14:03
This script will simplify the extracting of urls for recorded video sessions from any of the CareerERA tracks.
"""CareerERA Video Extractor
This script will simplify the extracting of urls for recorded video sessions from any
of the CareerERA tracks.
How to use:
1. Save this script to your computer.
2. Go to your dashboard and navigate to the "Live Virtual Class" section.
3. Click on the "View" link to the Day of the session that you want to get.
@clamytoe
clamytoe / covid.py
Last active June 3, 2020 10:23
Daily COVID plot generator.
#!/usr/bin/env python3
from urllib.error import URLError
from pathlib import Path
import click
import matplotlib.pyplot as plt # type: ignore
import pandas as pd # type: ignore
import seaborn as sns # type: ignore
from us_state_abbrev import us_state_abbrev
@clamytoe
clamytoe / keywords.py
Created May 12, 2020 09:39
Small little script to retrieve the keywords from any web page.
#!/usr/bin/env python3
"""keywords.py
Small little script to retrieve the keywords from any web page.
You can either pass the url for the page as an argument or enter
it when prompted for it.
Example:
keywords.py https://www.youtube.com/watch?v=YrHlHbtiSM0
from copy import deepcopy
from functools import wraps
from random import sample
from time import time
from typing import List
DEBUG = False
def id_checker(func):
@clamytoe
clamytoe / cleanup-yml.py
Last active August 11, 2021 13:36
Script to cleanup an Anaconda environment exported environment.yml file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pathlib import Path
def clean_yaml(file: Path, skip: int = 5) -> str:
"""Cleans up an Anaconda environment file
The contents of the file are generated by issuing the following
command from within an activated Anaconda environment:
@clamytoe
clamytoe / Makefile
Created March 18, 2020 13:42 — forked from JnyJny/Makefile
Generate HTML, PDF, EPUB and MOBI from ASCIIDoctor Source
# Makefile - Generate HTML, PDF, EPUB, MOBI from ASC
# This is how you assign a string to a variable name in 'make'. The
# variable name doesn't have to be all caps and the equal doesn't have
# to be snugged up to the variable name; it's just how I write
# Makefiles
FILENAME= the_document
# $(IDENTIFIER) is how you reference a 'make' variable, you can use
@clamytoe
clamytoe / mc-one_person_sleep.md
Last active February 20, 2022 16:39
Minecraft - One Person Sleep

Minecraft - One Person Sleep

It's always frustrating getting everyone on the server to go to sleep to prevent mobs from spawning and having to carry a "travel bed" takes up precious space when out gathering resources. With this setup only one person needs to sleep in order for the night cycle to be skipped.

Based on this video: Super Simple VANILLA MINECRAFT ONE PLAYER SLEEPING|1.13-1.14+

setup