This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
youtube-dl --extract-audio --audio-format mp3 <youtube-url> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import pathlib | |
import os | |
import shutil | |
import unrar.rarfile | |
# Convert the title to a string that is safe to use as a filename | |
def make_filename(string): | |
keepcharacters = (' ','.','_') | |
string = string[2:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ENV_PATH="$(dirname "$(dirname "$(which pip)")")" | |
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)" | |
BAD_ENV_PATHS="/usr/local" | |
echo "Ensure the root of the broken virtualenv:" | |
echo " $ENV_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import pathlib | |
def valid_dir_arg(value): | |
""" Used by argparse to determine if the value is a valid directory """ | |
filepath = pathlib.Path(value) | |
if not filepath.exists() or not filepath.is_dir(): | |
msg = f'Error! This is not a directory: {value}' | |
raise argparse.ArgumentTypeError(msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow | |
import jinja2 | |
# Set up the template engine | |
template_loader = jinja2.FileSystemLoader('./templates') | |
template_env = jinja2.Environment(loader=template_loader) | |
template_env.filters['fmt_date'] = lambda v: arrow.get(v, fmt).format(fmt) | |
# Write the file | |
template = template_env.get_template('template.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
colors = { | |
'prearrival': (165, 226, 250, 255), | |
'arrived': (253, 245, 210, 255), | |
'waiting': (170, 255, 190, 255), | |
'waiting_long': (255, 160, 159, 255), | |
'unreviewed': (255, 160, 159, 255), | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link rel="shortcut icon" href="#" /> | |
<style></style> | |
<script></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
window.app = new Vue({ | |
el: 'div#app', | |
store: store, | |
data: { | |
message: 'Hello from Vue!' | |
}, | |
mounted() { | |
this.$store.commit('updateColor', 'purple'); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import arrow | |
import pathlib | |
def valid_date_arg(value): | |
""" Used by argparser to validate date arguments """ | |
try: | |
return arrow.get(value, 'YYYY-MM-DD') | |
except arrow.parser.ParserError: | |
msg = f'Not a valid date in YYYY-MM-DD format: "{value}"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import feedparser | |
import pathlib | |
import posixpath | |
import requests | |
import tqdm | |
import urllib | |
feed = feedparser.parse('https://feeds.buzzsprout.com/981391.rss') | |
urls = [] |