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/env python | |
"""Pyhton function to check installed packages version from shell. Pure python, no requirements. | |
""" | |
# define CLI colors | |
RED = '\033[31m' # mode 31 = red forground | |
GREEN = '\033[1;32m' # mode 32 = green forground | |
CYAN = '\033[34m' # mode 32 = green forground | |
RESET = '\033[0m' # mode 0 = reset |
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
data/ | |
# Created by https://www.toptal.com/developers/gitignore/api/python | |
# Edit at https://www.toptal.com/developers/gitignore?templates=python | |
### Python ### | |
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class |
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
[cpu-freq] | |
interval=5 | |
# standard color scale. MUST BE 4 VALUES. | |
# COLORS_FREQ='#85cc00,#b58900,#cb4b16,#dc322f' | |
# in MHz, if set Min/Max are not used. MUST BE 3 VALUES. | |
# FREQUENCIES='1500,2300,3100' | |
# Freq max/min MHz | |
# MIN_FREQ=1400 | |
# MAX_FREQ=4100 | |
# number of frequency intervals for color |

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
#!/bin/bash | |
# | |
# Simple creation of a single-app django project, as described in: https://zindilis.com/posts/django-anatomy-for-single-app/ | |
# | |
# ./django_init foo | |
# | |
# This will result is the following flat structure: | |
# | |
# . | |
# └── foo |
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
#------------------------------------------------ | |
# Name : yt-streamer | |
# Input : youtube URL | |
# Purpose : stream url video to mpv. see: | |
# https://github.com/ytdl-org/youtube-dl/issues/2124#issuecomment-32429104 | |
#------------------------------------------------ | |
yt-streamer() { | |
# locale colors do not work in sub-functions | |
open=$'\001' | |
close=$'\002' |
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/env python | |
"""Show table content with rich. Quick'n'dirty: no validity checks, only the fun :-D. | |
""" | |
import sys | |
from pandas import read_csv | |
from rich import print | |
from pathlib import Path | |
import os | |
size = os.get_terminal_size() | |
for p in sys.argv[1:]: |

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
# tested using https://github.com/uber/h3-py-notebooks/blob/master/notebooks/usage.ipynb | |
from h3 import h3 | |
from shapely.geometry.polygon import Polygon | |
h3_list = [ Polygon(h3.h3_to_geo_boundary(he)) for he in h3.hex_ring(h,2)] | |
n = len(h3_list) | |
print(f'Polygon.exterior.is_closed = {h3_list[0].exterior.is_closed}') | |
import geopandas as gpd |
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
#!/bin/sh | |
# see https://unix.stackexchange.com/questions/467524/open-file-from-history-in-zathura | |
# save filepaths in history to array, reverse order | |
readarray -t Data < <(grep -o '/.*\.[[:alpha:]]\{,3\}' ~/.local/share/zathura/history | tac) | |
# loop and unset not existing files | |
for i in "${!Data[@]}" | |
do | |
if ! [ -e "${Data[$i]}" ]; then |