Instantly share code, notes, and snippets.

View md-diff.sh
#!/bin/bash
# arguments: file commit commit [diff tool with args]
${4:-diff} \
<(git show "$2:$1" | ./xep2md.sh -) \
<(git show "$3:$1" | ./xep2md.sh -)
View mod_s2s_certinfo.lua
local xmlns = "http://zash.se/protocol/s2scertinfo";
local st = require"util.stanza";
-- local dump = require"myserialize".serialize;
local base64_encode = require"util.encodings".base64.encode;
local s_char, s_gsub = string.char, string.gsub;
local tonumber = tonumber;
local function unhexbyte(c) return s_char(tonumber(c, 16)) end
local function unhex(s) return s_gsub(s, "..", unhexbyte) end
local function hex2b64(s) return base64_encode(unhex(s)) end