Skip to content

Instantly share code, notes, and snippets.

View wteuber's full-sized avatar

Wolfgang Teuber wteuber

View GitHub Profile
@wteuber
wteuber / volume.md
Last active February 3, 2024 21:50
FFmpeg - Audio Volume Manipulation

Audio Volume Manipulation

ffmpeg -i input.mp4 -af "volume=<volume_level>" output.mp4
input.mp4: The input video file.
-af: Stands for audio filter. This option tells FFmpeg to apply an audio filter.
@wteuber
wteuber / reduce_pdf.sh
Created February 1, 2024 16:18 — forked from knugie/reduce_pdf.sh
reduce pdf size
#reduce PDF size
#-dPDFSETTINGS
# /screen
# /ebook
# /printer
# /prepress
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -sOutputFile=out.pdf in.pdf
@wteuber
wteuber / install_eventmachine.md
Created September 26, 2023 10:01
MacOS M1 installing eventmachine (1.2.7)
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  github-pages was resolved to 228, which depends on
    jekyll-avatar was resolved to 0.7.0, which depends on
      jekyll was resolved to 3.9.3, which depends on
        em-websocket was resolved to 0.5.3, which depends on
 eventmachine
@wteuber
wteuber / list_gists_with_url.sh
Created September 23, 2023 19:46
List gists with gh cli
# install and set up gh (https://cli.github.com/)
GH_USER=`gh auth status | grep -oue "Logged in to github.com as [^ ]*" | grep -oue "[^ ]*$"`
gh gist list -L1000 | sed -e "s/^/https:\/\/gist.github.com\/$GH_USER\//"
@wteuber
wteuber / .zshrc
Last active November 14, 2023 12:46
git aliases
# Print origin/HEAD branch name (default branch)
gdb() {
git remote show origin | grep 'HEAD branch' | cut -d ' ' -f5
}
# Print origin/HEAD branch name (default branch)
# uses ohmyzsh git plugin aliases https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh
gcdb() {
gco `gdb`
}
@wteuber
wteuber / iterm_open_file_in_intellij_idea.md
Last active May 24, 2023 13:22
iterm_open_file_in_intellij_idea
[ -z "\2" ] &&  /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea \1 || /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea --line \2  \1

image

@wteuber
wteuber / iterm_open_file_in_rubymine.md
Created May 22, 2023 13:10
iTerm open file in RubyMine
[ -z "\2" ] &&  /usr/local/bin/mine \1 || /usr/local/bin/mine --line \2  \1

image

@wteuber
wteuber / git_checkout_branch_from_previous_commit_message_ruby.sh
Last active June 14, 2023 08:28
Git checkout branch from previous commit message
git checkout -b `git log -1 --pretty=%s | ruby -e "puts gets.downcase.gsub(/[^a-zA-Z0-9]+/, ' ').strip.tr(' ','_')"`
@wteuber
wteuber / iterm-colors-to-vscode.js
Created May 18, 2022 13:10 — forked from experimatt/iterm-colors-to-vscode.js
A simple script to use your iTerm color profile in vscode's built-in terminal.
// This script takes an iTerm Color Profile as an argument and translates it for use with Visual Studio Code's built-in terminal.
//
// usage: `node iterm-colors-to-vscode.js [path-to-iterm-profile.json]
//
// To export an iTerm Color Profile:
// 1) Open iTerm
// 2) Go to Preferences -> Profiles -> Colors
// 3) Other Actions -> Save Profile as JSON
//
// To generate the applicable color settings and use them in VS Code:
@wteuber
wteuber / git_branch_gone_prune_delete.sh
Last active October 29, 2019 13:36
git: prune and delete gone local branches
#!/usr/bin/env bash
git remote prune origin && git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d