Skip to content

Instantly share code, notes, and snippets.

@mojabyte
mojabyte / ffmpeg-compress.sh
Last active April 12, 2024 11:56
Reduce video's size with ffmpeg
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
@mojabyte
mojabyte / options-to-composition-codemod.js
Created February 16, 2024 15:43
Vue 3 codemod: Options API to Composition API and Script Setup
// Usage: pnpm vue-codemod "client/**/*.vue" -t codemods/options-to-composition.cjs
// TODO: add support for "data" option
const IGNORED_OPTIONS = ['name', 'components'];
const LIFECYCLE_METHODS = {
created: 'onCreated',
beforeMount: 'onBeforeMount',
mounted: 'onMounted',
@mojabyte
mojabyte / ffmpeg-add-subtitles.md
Created October 12, 2023 17:21 — forked from spirillen/ffmpeg-add-subtitles.md
Use FFmpeg to add subtitles to video

Use FFmpeg to add subtitles to video

MP4:

ffmpeg -i input.mp4 -f srt -i input.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy \
    -c:a copy -c:s mov_text output.mp4

MKV:

@mojabyte
mojabyte / wsl-open.sh
Last active September 23, 2023 17:41
Open files, directories, and URL from WSL
# Add this function to ~/.bashrc
function open() {
cmd.exe /C start `wslpath -w "$1"`
}
alias openurl='cmd.exe /C start'