Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
-> The Band Red

Colten Krauter coltenkrauter

🎧
-> The Band Red
View GitHub Profile
@coltenkrauter
coltenkrauter / html-input-remove-chrome-autofill-background.css
Last active Nov 29, 2019
Remove Chrome's autofill background color on HTML inputs. This unique solution makes the background color to transparent rather then a solid color.
View html-input-remove-chrome-autofill-background.css
// 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
@coltenkrauter
coltenkrauter / pretty_json.py
Last active Nov 15, 2019
A simple helper function for formatting/indenting a Python object as JSON.
View pretty_json.py
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)
@coltenkrauter
coltenkrauter / normalize-audio.py
Created Oct 24, 2019
Python code for normalizing audio files.
View normalize-audio.py
# 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")