Skip to content

Instantly share code, notes, and snippets.

Avatar

LosEagle

View GitHub Profile
@LosEagle
LosEagle / flac-to-mp3.sh
Created Oct 24, 2021
Flac to MP3 320kbps conversion via ffmpeg
View flac-to-mp3.sh
#!/bin/bash
for a in ./*.flac; do
< /dev/null ffmpeg -i "$a" -ab 320k -map_metadata 0 -id3v2_version 3 "${a[@]/%flac/mp3}"
done
@LosEagle
LosEagle / win_to_wsl_path_replacer.exs
Last active Jun 20, 2021
Replaces classic string with Windows path to WSL path
View win_to_wsl_path_replacer.exs
defmodule WinToWslPathReplacer.PathHandler do
@moduledoc """
Takes care of converting Windows to WSL path string
"""
def convert(path) do
path
|> String.replace("C:", "/mnt/c")
|> String.replace("D:", "/mnt/d")
|> String.replace("\\", "/")
|> String.replace("\n", "")
@LosEagle
LosEagle / simple_interval_backup.exs
Last active Apr 25, 2021
Elixir script for backing up directories in intervals
View simple_interval_backup.exs
defmodule SimpleIntervalBackup.Time do
@moduledoc """
Interval time related helpers
"""
def minutes_to_millis(minutes) do
minutes * 60000
end
end
defmodule SimpleIntervalBackup.Interval do