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 logging | |
from sys import stdout | |
# Define logger | |
logger = logging.getLogger('mylogger') | |
logger.setLevel(logging.DEBUG) # set logger level | |
logFormatter = logging.Formatter\ | |
("%(name)-12s %(asctime)s %(levelname)-8s %(filename)s:%(funcName)s %(message)s") | |
consoleHandler = logging.StreamHandler(stdout) #set streamhandler to stdout |
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
'downloader/response_count': 2, | |
'downloader/response_status_count/200': 2, | |
'elapsed_time_seconds': 0.805264, | |
'finish_reason': 'finished', | |
'finish_time': datetime.datetime(2021, 12, 19, 9, 29, 10, 427176), | |
'httpcompression/response_bytes': 62728, | |
'httpcompression/response_count': 2, | |
'log_count/DEBUG': 3, | |
'log_count/INFO': 11, | |
'memusage/max': 82173952, |
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
let | |
pkgs = import <nixpkgs> { }; | |
mach-nix = import (builtins.fetchGit { | |
url = "https://github.com/DavHau/mach-nix/"; | |
ref = "master"; | |
}) { python = "python38"; }; | |
customPython = mach-nix.mkPython rec { | |
providers._default = "wheel,conda,nixpkgs,sdist"; | |
requirements = builtins.readFile ./requirements.txt; | |
}; |
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
# Generated by Powerlevel10k configuration wizard on 2021-09-24 at 17:27 CEST. | |
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 54401. | |
# Wizard options: compatible, unicode, lean, 24h time, 2 lines, dotted, left frame, | |
# light-ornaments, sparse, fluent, transient_prompt, instant_prompt=verbose. | |
# Type `p10k configure` to generate another config. | |
# | |
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate | |
# your own config based on it. | |
# | |
# Tip: Looking for a nice color? Here's a one-liner to print colormap. |
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 matplotlib.pylab as plt | |
from matplotlib import animation | |
FPS = 12 | |
FRAMES = range(30,90) # iterator for animate function | |
FILENAME = 'basic_animation.mp4' | |
# Create fig and axes | |
fig, ax = plt.subplots(figsize=(20,10)) |
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 matplotlib.pyplot as plt | |
from math import ceil | |
# Parameters for data. I assume data is in df. | |
cluster_col = "cluster" # Column with clusters | |
group_by = "customer_city" # Metric to group by "city" etc. | |
n_first = 4 # Number of most popular entries of `group_by` in cluster to include | |
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
#!/bin/bash | |
# Convert all .mkv files in directory (recursive) to .mp3 | |
find . -type f -name "*.mkv" -print0 | parallel -0 ffmpeg -i {} -vn -c:a libmp3lame -y {.}.mp3; |