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 / 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

@clamytoe
clamytoe / poker.py
Created June 6, 2019 19:07
Quick little generic card game demo
from dataclasses import dataclass, field
from random import shuffle
from secrets import choice
from typing import Dict, Generator, List
NUMBERS: List[str] = list(map(str, range(1, 11)))
FACES: List[str] = "J Q K A".split()
SUITS: List[str] = "♠ ♥ ♦ ♣".split()
FACE_SCORES: Dict[str, int] = {"J": 11, "Q": 12, "K": 13, "A": 14}
@clamytoe
clamytoe / xor.py
Created October 11, 2018 13:26
xor.py
""" xor.py
My attempt to complete the challenge at:
https://www.geeksforgeeks.org/calculate-xor-1-n/
"""
import timeit
from functools import reduce
@clamytoe
clamytoe / extract_audio.py
Created September 13, 2018 16:00
Utility to extract the audio from a video file.
#!/usr/bin/env python
import argparse
from os import path, system
# specify the location of your ffmpeg binary
ffmpeg = "/home/mohh/anaconda3/pkgs/ffmpeg-4.0-h04d0a96_0/bin/ffmpeg"
def parser():
"""Argument parser"""