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
# LICENSE: public domain | |
import warnings | |
from openpyxl.cell import Cell | |
from openpyxl.worksheet.worksheet import Worksheet | |
from openpyxl.styles.stylesheet import Stylesheet, BUILTIN_FORMATS_MAX_SIZE, BUILTIN_FORMATS | |
from openpyxl.drawing.text import Font as DrawingFont | |
from openpyxl.descriptors import MinMax | |
from copy import copy | |
from contextlib import suppress |
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
{ | |
"af": { | |
"currencyName": "Afghan afghani", | |
"currencyIso": "AFN", | |
"countryName": "Afghanistan", | |
"symbol": "\u060b", | |
"decimalPoint": ".", | |
"thousandsSeparator": ",", | |
"decimalPlaces": 2 | |
}, |
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
function isNewerVersion(oldVer, newVer) { | |
const oldParts = oldVer.split('.'); | |
const newParts = newVer.split('.'); | |
for (var i = 0; i < newParts.length; i++) { | |
const a = ~~newParts[i]; // parse int | |
const b = ~~oldParts[i]; // parse int | |
if (a > b) return 1; | |
if (a < b) return -1; | |
} | |
return 0 |
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
[target.'cfg(target_os = "linux")'.dependencies] | |
dbus = "0.9" |
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 | |
import argparse | |
import subprocess | |
from subprocess import DEVNULL | |
import os | |
import glob | |
from pathlib import Path | |
import time | |
import shutil | |
import sys |
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 soundfile as sf | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import io | |
from PIL import Image | |
def get_audio_wave(file): | |
data, samplerate = sf.read(file) | |
n = len(data) |
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
# sudo chmod +x update_monerod.sh | |
sudo sytemctl stop monerod | |
mkdir -p ~/Downloads && cd ~/Downloads | |
echo "Downloading and extracting Monero binaries" | |
curl -L https://downloads.getmonero.org/cli/linux64 | tar xj | |
rm -r -f ~/bin/monero && mkdir -p ~/bin | |
mv monero-*-linux-* monero | |
mv monero ~/bin | |
sudo systemctl start monerod |
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
# abstracted from https://github.com/elibroftw/music-caster/blob/master/src/music_caster.py :: get_audio_uris | |
import glob | |
import os.path | |
from pathlib import Path | |
MY_EXTS = {'.mp3', '.flac', '.m4a', '.mp4', '.aac', '.mpeg', '.ogg', '.opus', '.wma', '.wav'} | |
def valid_file_ext(uri) -> bool: | |
""" |
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 pandas as pd | |
import openpyxl | |
df = pd.read_excel(r'C:\Users\maste\Downloads\countries.xlsx') | |
javascript_1 = 'export const countries = [\n' | |
javascript_2 = 'export const countries_fr = [\n' | |
for _, row in df.iterrows(): | |
row['EN'] = row['EN'].replace('’', "'") |
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
# ... | |
# .env_path format: | |
# path1 | |
# path2 | |
if [ -f ~/.env_path ]; then | |
export PATH=$PATH:$(python3 -c "import os; print(':'.join((line.strip() for line in open('.env_path').readlines() if line.strip())))") | |
fi | |
# Python code: |
NewerOlder