View normalize-audio.py
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
# Credit: https://stackoverflow.com/questions/42492246/how-to-normalize-the-volume-of-an-audio-file-in-python-any-packages-currently-a#answer-42496373 | |
# pip install pydub | |
from pydub import AudioSegment | |
def match_target_amplitude(sound, target_dBFS): | |
change_in_dBFS = target_dBFS - sound.dBFS | |
return sound.apply_gain(change_in_dBFS) | |
sound = AudioSegment.from_file("yourAudio.m4a", "m4a") |
View pretty_json.py
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 json | |
# Example usage: print(pretty_json(some_dict)) | |
def pretty_json(object): | |
try: | |
return json.dumps(object, indent=4) | |
except Exception as exception: | |
print("---> Unable to parse object as JSON") | |
return str(object) | |
View fix-chmod-wsl2.sh
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
# Remount NTSF drive in WSL2 with the metadata option so chmod will work. | |
sudo umount /mnt/c | |
sudo mount -t drvfs C: /mnt/c -o metadata | |
# If you get an error "target is busy" then try to cd / before running the above commands. You may also have to exit other terminals that are using WSL2. |
View git-automatic-commit-signing
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
# I am using WSL2 on Windows 10 | |
# Generate GPG key | |
gpg --full-generate-key | |
# List keys, find the one you just made and grab the key id | |
gpg --list-secret-keys --keyid-format LONG | |
# OUTPUT | |
# sec rsa4096/1124F0AFF0B78C69 2019-10-16 [SC] # LONG key id in this case is 1124F0AFF0B78C69 |
View .zprofile
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
# Setup subl | |
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl > /dev/null 2>&1 | |
# Helper functions | |
commit() { | |
echo '\nCommit message: ' | |
local temp | |
vared temp | |
echo '' |
View docker-pip3-cryptography-dependency
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
# https://github.com/odoo/odoo/issues/8849#issuecomment-322115976 | |
# For APT | |
apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev | |
# For APK | |
apk add python3-dev libffi-dev libressl-dev openldap-dev | |
# Example alpine docker file | |
FROM python:3.7-alpine |
View nginx.conf
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
# https://www.zeolearn.com/magazine/setting-caching-headers-for-a-spa-in-nginx-cache | |
server { | |
listen 80; | |
server_name localhost; | |
root /usr/share/nginx/html; | |
# X-Frame-Options is to prevent from clickJacking attack | |
add_header X-Frame-Options SAMEORIGIN; | |
View terminus.sublime-keymap
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
Show hidden characters
[ | |
{ | |
"keys": ["ctrl+t"], "command": "toggle_terminus_panel", | |
"args": { | |
"config_name": "Default", | |
"panel_name": "output", | |
} | |
}, | |
{ | |
"keys": ["ctrl+w"], "command": "terminus_close", "context": [{ "key": "terminus_view"}] |
View .profile
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
# ~/.profile | |
cd ~/Repositories | |
# Useful aliases | |
alias subl="/mnt/c/Program\ Files/Sublime\ Text\ 3/subl.exe" | |
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe" | |
alias github="chrome https://github.com/coltenkrauter?tab=repositories" | |
alias downloads="echo /mnt/c/Users/Colten/Downloads/" | |
alias clo="git clone" |
View html-input-remove-chrome-autofill-background.css
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
// Remove chrome autofill color from inputs | |
input:-webkit-autofill, | |
input:-webkit-autofill:hover, | |
input:-webkit-autofill:focus, | |
input:-webkit-autofill:active { | |
transition: background-color 5000000s ease-in-out 0s; | |
} | |
# Credit: https://stackoverflow.com/questions/2781549/removing-input-background-colour-for-chrome-autocomplete#answer-29350537 |
OlderNewer