Skip to content

Instantly share code, notes, and snippets.

View garfvl's full-sized avatar

Simon Latapie garfvl

View GitHub Profile
@garfvl
garfvl / vlc-stacktrace-howto-windows.md
Last active August 27, 2020 16:13
"Easy" way to get a stacktrace on VLC crash on Windows

"Easy" way to get a stacktrace on VLC crash on Windows

  1. Install msys2 + gdb:

    1. Install msys2 (64bits version)

    2. In msys2 command line, install gdb:

msys:~$ pacman -S mingw-w64-x86_64-gdb

Tig: Splitting a single-file commit the easy way

The problem

A common issue during a branch rebase:

  • merging multiple commits is pretty easy with the squash action
  • splitting a commit in smaller ones can be a pain in the *ss, especially if the changes are inside a common file.

An example of "to split" commit:

@garfvl
garfvl / gitrebase.vim
Last active July 26, 2020 14:59
Display commit information during interactive rebase in (neo)VIM
" Display `git show <commit>` during interactive rebase in the preview window
function! PreviewCommitDuringRebase()
try
if getline(".") =~ '^\s*#'
throw "This is a comment line, do not preview"
endif
" get 2nd column == commit hash. Will fail if 2nd does not exists
let hash = split(getline('.'))[1]
let commitshow = systemlist("git show " . hash)
@garfvl
garfvl / passk
Last active May 11, 2023 08:13
passk: simplistic script to store ssh keys in pass/gopass and use them. Works with gopass, should work with pass.
#!/bin/bash
command=$1
PASSK_BACKEND=${PASSK_BACKEND:-gopass}
pass_show() {
case $PASSK_BACKEND in
pass)
pass show "$1"