Skip to content

Instantly share code, notes, and snippets.

Jordan Torbiak torbiak

Block or report user

Report or block torbiak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View taketilcap
#!/bin/bash
usage='usage taketilcap [-h|--help] <capacity>
-h Show help
Filter newline-delimited filenames provided on stdin'
[[ $# -lt 1 ]] && {
echo "$usage"
exit 1
View beef_stew.md

Discussion

This stew hit such a sweet spot of convenience, tastiness, economy, and vegetable density that I cooked it weekly for about 2 years, eating the leftovers for several days of each week. It's mostly based off of Mark Bittman's Beef Stew with Guinness (the url is broken, sadly) and the Classic Beef Stew recipe from his How to Cook Everything (p. 435).

Beef

I get the packs of stewing beef at the closest Superstore. The price is usually fine and I enjoy the variety of cuts they contain and the intermediate fat content. Mark Bittman recommends round or chuck. In Canada I think chuck is called either blade or shoulder. Blade is the more flavourful of the two but it's maybe too fatty, and the flavour isn't always the best. Round is relatively tough, bland, and lean, but it's consistent and I consider it the safer choice. Round roast also seems more likely to be available.

I've cooked this many times, some browning the beef and some

@torbiak
torbiak / SplitCol.vba
Created Jan 30, 2018
Excel VBA subroutine to split a multi-value column into multiple boolean columns
View SplitCol.vba
' Split the selected column containing values like "a;b;c", "a;c" into boolean
' 0/1 columns for each of "a", "b", "c".
Sub SplitCol()
Dim c As Range
Dim newCols As Object
Dim ncols As Long
ncols = 0
Set newCols = CreateObject("Scripting.Dictionary")
For Each c In Intersect(ActiveSheet.UsedRange, Selection.EntireColumn).Offset(1)
Dim s As Variant
@torbiak
torbiak / syncxcode
Created Jul 28, 2017
Sync audio/video files in some format in SRC to another format in DST.
View syncxcode
#!/bin/bash
# usage: syncxcode SRC DST
set -eu
max_procs=3
src_format=flac
dst_format=mp3
function sync {
set -eu
@torbiak
torbiak / mrmgroup.pl
Created Feb 3, 2017
Print the group of files modified within an hour of the most recently modified file
View mrmgroup.pl
#!/usr/bin/env perl
# Print the group of files modified within an hour of the most recently
# modified file.
use strict;
use List::Util qw[min max];
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
sub HELP_MESSAGE {
@torbiak
torbiak / groff-install-font
Created Jan 13, 2017
Install ttf and otf fonts for use with groff
View groff-install-font
#!/usr/bin/env bash
# groff-install-ttf converts a TrueType (ttf) or OpenType (otf) font to a
# Printer Font ASCII (pfa) font and a groff font (ditroff) and installs them to
# groff's site-font directory.
#
# Requires fontforge.
#
# You're the best, Peter Schaffter, but contrary to the verbose and
# difficult-to-follow http://www.schaffter.ca/mom/momdoc/appendices.html#fonts,
# the t42 file doesn't seem to be necessary, at least with recent versions of
@torbiak
torbiak / grabtest.c
Created Jan 5, 2017
Reproduce X11 bug where the second KeyRelease event is missing if two grabbed keys are released in quick succession.
View grabtest.c
// grabtest tries to reproduce an X11 bug where, when two keys grabbed using
// XGrabKey are held down and then quickly released, the second KeyRelease
// event never makes it to the event queue.
//
// make LDFLAGS=-lX11\ -lXtst grabtest
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
#include <X11/Xlib.h>
@torbiak
torbiak / pass
Last active Apr 9, 2016
Copy passwords from a vim-encrypted file to the clipboard.
View pass
#!/usr/bin/env bash
IFS=$'\t\n'
set -eu
set -o pipefail
PASS_FILE=${PASS_FILE:-~/notes/numbers.md}
PASS_CLIP_TIME=${PASS_CLIP_TIME:-30}
not_found=2
no_password=3
@torbiak
torbiak / format-srt.rb
Created Apr 4, 2016
Clean and format subrip subtitles that have been converted from ASS format by ffmpeg.
View format-srt.rb
#!/usr/bin/env ruby
require 'text/format'
class Entry
attr_accessor :flighting, :body
def initialize
@body = []
end
@torbiak
torbiak / gtff.py
Last active Apr 17, 2016
Guess Tag From Filename
View gtff.py
#!/usr/bin/env python
# Guess Tags From Filename, using python and mutagen.
import mutagen
from mutagen.easyid3 import EasyID3
import re
import os.path
import sys
You can’t perform that action at this time.