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
{ | |
"af": { | |
"currencyName": "Afghan afghani", | |
"currencyIso": "AFN", | |
"countryName": "Afghanistan", | |
"symbol": "\u060b", | |
"decimalPoint": ".", | |
"thousandsSeparator": ",", | |
"decimalPlaces": 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
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 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 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 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 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 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 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 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
## HELPERS AND CONSTANTS | |
def is_already_running(look_for='Music Caster', threshold=1): | |
raise NotImplementedError('https://gist.github.com/elibroftw/44844582287ce7386d1d9d5060e52972') | |
MUTEX_NAME = 'MusicCasterMutex{{FBE8A652-58D6-482D-B6A9-B3D7931CC9C5}' | |
PID_FILENAME = 'music_caster.pid' | |
LOCK_FILENAME = 'music_caster.lock' |
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
# ... | |
# .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