Skip to content

Instantly share code, notes, and snippets.

View evadecker's full-sized avatar
🌱
digital gardening

Eva Decker evadecker

🌱
digital gardening
View GitHub Profile
@evadecker
evadecker / no-autofill.css
Last active April 24, 2025 22:03
Disable browser native autofill styles
.disable-autofill:-webkit-autofill,
.disable-autofill:autofill {
/* Browsers apply !important styles to the background color and text color of autofilled fields,
making them impossible to override. Instead, we can set an extremely slow background transition
to avoid displaying native styles. This requires setting your preferred styles on a wrapper
element using the :autofill pseudo selector. */
transition-property: background-color, color;
transition-delay: 0s;
transition-duration: 2147483647s;
transition-timing-function: linear;
@evadecker
evadecker / README.md
Created September 5, 2024 23:57
Webhook: Better Stack Incident to Discord

Post Better Stack incident alerts to Discord

You can post incidents from Better Stack to a channel on Discord using webhooks.

  1. Add a new Webhook from your Discord server. Server Settings > Integrations > Webhooks.
  2. Name your bot and set what channel it posts to. CleanShot 2024-09-05 at 19 50 29@2x
  3. Copy the Webhook URL.
  4. In the Better Stack Admin, go to Integrations > Exporting Data > Outgoing webhooks > Configure > Incident webhook > Add.
  5. Paste your Discord webhook URL.
  6. Expand Advanced Settings.
@evadecker
evadecker / framestomp4.sh
Created February 26, 2024 04:42
Convert .png frames to a video
# 1 frame per second
ffmpeg -framerate 1 -pattern_type glob -i '*.png' \
-c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
# 30 frames per second
ffmpeg -framerate 30 -pattern_type glob -i '*.png' \
-i audio.ogg -c:a copy -shortest -c:v libx264 -pix_fmt yuv420p out.mp4
@evadecker
evadecker / convertmp4.sh
Created February 17, 2024 02:34
Convert .mov to .mp4
ffmpeg -i "input.mov" "output.mp4"
@evadecker
evadecker / generateposter.sh
Last active February 17, 2024 03:27
Generate poster .png image from first frame of .mp4
# Generate a poster from the first frame
ffmpeg -i input.mp4 -vframes 1 output.png
# Generate a poster from the frame starting at 5 seconds
ffmpeg -i input.mp4 -ss 00:00:05 -vframes 1 output.png
@evadecker
evadecker / increasevolume.sh
Created November 23, 2018 21:19
Increase the volume of a sample
# Change 10dB to the amount you'd like to bump the volume.
# You can use negative values to decrease volume, too.
ffmpeg -i input.wav -filter:a "volume=10dB" output.wav
@evadecker
evadecker / trimsilence.sh
Created November 23, 2018 21:16
Trim start/end silence on audio files
# This will overwrite the original file! Be careful!
# I use ZSH. If you use Bash, the syntax will be different here.
# Options:
# Change -20dB to whatever threshold you consider "silent" to be.
for file in *.mp3; ffmpeg -y -i $file -af silenceremove=1:0:-20dB ${file%.mp3}.mp3
@evadecker
evadecker / audiosprite.sh
Last active November 23, 2018 21:14
Generate an audiosprite for use with Howler
# For use with https://github.com/tonistiigi/audiosprite
# and https://github.com/goldfire/howler.js/
# Replace outputNameWithoutExtension with whatever you want.
#
# *.mp3 will find all mp3 files in the current directory.
#
# * will find ALL files in the current directory, allowing you
# to mix wav, mp3, etc into the final combined sprite.
@evadecker
evadecker / bitrate.sh
Created November 23, 2018 21:11
Lower bitrate of an mp3 file
# Command to lower the bitrate of an mp3 using FFMPEG
# Options:
# Low: 96k
# Medium (Radio quality): 128k
# Medium-High (CD quality): 192k
# High: 320k
# "Converting an MP3 to a higher bit rate does not add any more
# audio information to the file, so the sound quality does not
@evadecker
evadecker / audioshift.sh
Last active November 23, 2018 21:05
Shift audio pitch up or down
# Calculations courtesy of http://www.microsoftbob.com/post/Adjusting-Pitch-for-MP3-Files-with-FFmpeg
# Up half step
ffmpeg -i input.wav -filter:a "asetrate=r=46722.3224612449211671764955071340,atempo=0.94387431268169349664191315" output_up_halfstep.wav
# Up whole step
ffmpeg -i input.wav -filter:a "asetrate=r=49500.5763304433484812188074908520,atempo=0.8908987181403393047402262055" output_up_wholestep.wav
# Up 3 half steps
ffmpeg -i input.wav -filter:a "asetrate=r=52444.0337716199990422417487017170,atempo=0.84089641525371454303112547623321" output_up_3halfsteps.wav