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 | |
# Function to calculate the total duration | |
calculate_total_duration() { | |
local dir="$1" | |
local total_duration=0 | |
# Loop through each audio file | |
while IFS= read -r -d '' file; do | |
# Check if the file is a .wav or .mp3 file |
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 | |
import os | |
def remove_silence(filename, noise_tolerance='-30dB', silence_duration='0.5'): | |
# Extract the base filename and extension | |
base_filename, extension = os.path.splitext(filename) | |
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 | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <input_song>" | |
exit 1 | |
fi | |
input_song="$1" | |
extension="${input_song##*.}" |
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
# Put this on /etc/systemd/system | |
[Unit] | |
Description=A very simple service | |
After=network-up.target | |
[Service] | |
ExecStart=/usr/bin/buckle | |
[Install] | |
WantedBy=multi-user.target |
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 requests | |
file_name: str = "hope_sandoval.jpg" | |
headers = { | |
'accept': 'application/json', | |
'Content-Type': 'multipart/form-data', | |
} | |
file = { |
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
""" | |
A python script that uses YouTube's API to | |
harvest a private playlist list. | |
It grabs video titles, publish dates, uploader information, etc. | |
You'll need a client_secret.json, which can be obtained here: | |
https://console.cloud.google.com/ | |
(OAuth 2.0 Client IDs) |
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
''' | |
Suppose I spend $20,000 on a mining rig, and it mines $120 worth of crypto each day. | |
We then consistently stake its daily revenue into a yield farming platform at a rate of 12% per year, | |
with the yield immediately claimed and restaked. | |
How much money would we make after n days? | |
At what day do we break even? (Assuming we're not paying for maintenance or electric bill) | |
''' |
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
/* | |
IMPORTANT: | |
You must have a .env file in the same directory as this script | |
that contains your personal access token. | |
Get one here: https://github.com/settings/tokens | |
In the .env , put your access token like so: | |
GH_TOKEN='ACCESS_TOKEN' |