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: |
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
| """ | |
| No Copyright. Public Domain. | |
| Version: 1.0.4 | |
| Known Issues: Common home folders like Documents, Music, Videos, arem missing. | |
| """ | |
| from functools import lru_cache | |
| from contextlib import suppress | |
| import sys | |
| from uuid import UUID | |
| from pathlib import Path |
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
| """ | |
| No Copyright by the way. | |
| Usage: | |
| 0. Have two terminals | |
| 1. In the first terminal run `test.py` | |
| 2. In the second terminal run `test.py a` | |
| 3. Magic! If you don't see anything, the arbitrary port 12025 may be in use so use another port | |
| Practical applications (requires more than just copy pasting this code): | |
| - Simple message queueing: |
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
| """ | |
| Supports: MyMonero | |
| Instructions (terminal, assuming you have python installed): | |
| pip install cryptography | |
| python[3] monero_wallet_decryption.py [path_to_wallet_dir] | |
| License: Public Domain | |
| You are permitted to run/edit/use any or all of this code without attribution. | |
| Free implies that there are no warranties. |
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 requests | |
| import os | |
| from contextlib import suppress | |
| from subprocess import Popen, PIPE, DEVNULL, CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW | |
| from requests import Session | |
| import platform | |
| from getpass import getpass | |
| from pathlib import Path | |
| from requests.auth import HTTPDigestAuth | |
| from pprint import pprint |
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 requests | |
| import concurrent.futures | |
| def get_todo(i, optional_arg=None): | |
| if i < 1: raise ValueError | |
| r = requests.get(f'https://jsonplaceholder.typicode.com/todos/{i}') | |
| return r.json() | |