Skip to content

Instantly share code, notes, and snippets.

@steinar
steinar / handbrake-rip-dvd.sh
Created December 19, 2021 13:44
HandBrakeCli command line arguments for transferring contents of a DVD disc to mp4
# Practical config with DVD resolution
HandBrakeCLI -i /mnt/dvd --preset "HQ 576p25 Surround" --main-feature --all-audio --all-subtitles --subtitle-burned=none -o output.mp4
# Faster encoding at the cost of picture quality
#HandBrakeCLI -i /mnt/dvd --preset "Fast 576p25" --main-feature --all-audio --all-subtitles --subtitle-burned=none -o output.mp4
@steinar
steinar / bazel-oh-my-zsh.md
Created August 12, 2019 18:12
Bazel command line auto-complete for oh-my-zsh

To get Bazel command and target auto-completion in zsh with oh-my-zsh, the offical zsh script as plugin:

  1. mkdir -p ~/.oh-my-zsh/plugins/bazel
  2. wget -P ~/.oh-my-zsh/plugins https://raw.githubusercontent.com/bazelbuild/bazel/master/scripts/zsh_completion/_bazel
  3. Add bazel to the plugins list in your ~/.zshrc
plugins=(git autojump colored-man-pages bazel)
  1. Restart zsh: zsh

Keybase proof

I hereby claim:

  • I am steinar on github.
  • I am steinarhugi (https://keybase.io/steinarhugi) on keybase.
  • I have a public key ASAwh5xF_Oja-u3-fP2TlwuvwdeIQSYR2Nf1AeOUqYlMNQo

To claim this, I am signing this object:

@steinar
steinar / hop-brewdog.txt
Created March 15, 2016 21:49
Brewdog's DIY DOG recipes ordered by total amount of hops
1.464 HBC 366
1.4015 DOG D
1.107 HBC 369
0.8915 HELLO MY NAME IS VLADIMIR
0.76 HELLO MY NAME IS LITTLE INGRID
0.7501 AB:02
0.725 RUSSIAN DOLL - BARLEY WINE
0.6535 HELLO MY NAME IS PAIVI
0.6125 SHAREHOLDER BLACK IPA 2011
0.575 SHIPWRECKER CIRCUS (W/OSKAR BLUES)

This PR improves the feed ranking algorithm

Main changes

  • Shorter time decay factor in 2nd phase, 12h instead of 24h.
  • "Fresh" stories (new since last feed generation) receive a modest boost of 1.2.
    • Date stored in redis_stream
  • Adding manual "boost" for individual events.
  • Posts created for player are massively boosted for 120 seconds.
  • Hotness part updated.
@steinar
steinar / gist:7927413
Created December 12, 2013 12:46
Time-tracking shell command: What are you doing right now? alias less8='LESSCHARSET="UTF-8" less'
#!/usr/bin/python
import sys
from datetime import datetime
when = datetime.now().isoformat(' ').split('.')[0]
what = " ".join(sys.argv[1:])
line = "%s | %s\n" % (when, what)
f = open("/Users/steinar/doing.log", "a")
f.writelines([line])
@steinar
steinar / pgftopdf.sh
Created April 13, 2011 15:12
Convert modified PGF (pgf/tikz) files to PDF
#!/bin/sh
# Convert modified PGF (pgf/tikz) files to PDF
pgfTemplate="template.pgs";
echo "Updating modified PGF files:"
for path in $(find . -iname "*.pgf")
do
pgfPath=`dirname $path`/`basename $path pgf`pdf;
if [ ! -e $pgfPath ] || [ $path -nt $pgfPath ]; then