Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@matiasw
matiasw / autosub.lua
Last active November 23, 2016 16:07 — forked from selsta/autosub.lua
Automatically download subtitles in mpv using subliminal.
-- requires subliminal, version 1.0 or newer
-- default keybinding: b
-- add the following to your input.conf to change the default keybinding:
-- keyname script_binding auto_load_subs
local utils = require 'mp.utils'
function load_sub_fn()
lang_ids = {"en", "es"}
subl = "/usr/bin/subliminal"
--local path = mp.get_property("working-directory").."/"..mp.get_property("path")
local pathfile = mp.get_property("path")
@matiasw
matiasw / gist:c90c4248659a6bffce03
Created June 24, 2015 11:54
geotag for git commit messages
This other day, I wanted to add a geotag to my git commits - like a character in Stephenson's Cryptonomicon has for email. Here's how I did it:
Requirements:
- jq
- nmcli
- perl
First, create a directory for git templates (eg. ~/.git). Then point git to globally use that directory: `git config --global init.templatedir ~/.git`
Then create a prepare-commit-msg hook:
~/.git/hooks/prepare-commit-msg:
echo "Made at meatspace coordinates " >> "$1"