This file contains hidden or 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
# alacritty | |
env: | |
TERM: xterm-256color | |
window: | |
dimensions: | |
columns: 120 | |
lines: 48 | |
padding: | |
x: 10 |
This file contains hidden or 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
# ~/.config/starship.toml | |
add_newline = false | |
[line_break] | |
disabled = true | |
[username] | |
format = "[$user]($style)" | |
style_user = "bold bright blue" | |
show_always = true |
This file contains hidden or 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
# convert all downloaded media to mp3 | |
# rename all converted files to remove {webm,mkv,mp4} from filenames | |
# echo file conversion list | |
# then delete everything but the newly converted mp3 | |
echo "starting up, get list of files, please be patient..." | |
ls | echo "Found $(wc -l) media files for conversion in the present working directory." | xargs | |
echo "starting mp3 conversion with ffmpeg and libmp3lame." | |
for i in *.{webm,mkv,mp4}; do | |
ffmpeg -i "$i" -acodec libmp3lame "$(basename "${i/.{webm,mkv,mp4}")".mp3 |
This file contains hidden or 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/python | |
import argparse | |
import csv | |
import json | |
import os | |
import requests | |
import sys | |
from requests.auth import HTTPBasicAuth | |
from urllib.parse import urlparse |
This file contains hidden or 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/python | |
from flask import Flask | |
from redis import Redis | |
app = Flask(__name__) | |
redis = Redis(host="172.17.0.2", port=6379) | |
@app.route("/", methods=["GET"]) |
This file contains hidden or 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 python:3.6-alpine | |
LABEL maintainer="Craig Derington <[email protected]>" | |
RUN apk update && apk upgrade | |
RUN apk add screen curl | |
COPY . /app | |
WORKDIR /app | |
RUN pip install -r requirements.txt | |
EXPOSE 8000 | |
CMD ["python", "app.py"] |
This file contains hidden or 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 os | |
import time | |
import uuid | |
import random | |
from datetime import datetime, timedelta | |
def get_message(): | |
return uuid.uuid4() |
This file contains hidden or 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 os | |
import hashlib | |
def sha256sum(filename): | |
""" | |
Create a file hash | |
:param: str (file path) | |
:return: str (md5 hash) | |
""" | |
h = hashlib.sha256() |
This file contains hidden or 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 asyncio | |
loop = asyncio.get_event_loop() | |
async def hello(): | |
await asyncio.sleep(3) | |
print('Hello!') | |
if __name__ == '__main__': | |
loop.run_until_complete(hello()) | |
This file contains hidden or 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/python3.6 | |
# coding: utf-8 | |
import time | |
from functools import wraps | |
def my_logger(func): | |
import logging | |
logging.basicConfig(filename='{}.log'.format(str(func.__name__)), level=logging.DEBUG) |