Skip to content

Instantly share code, notes, and snippets.

// content can be anything that implements read
let stci = Stci::from_input(&mut content.as_slice())
.map_err(|e| format!("error decoding `{:?}`: {}", file, e))?;
let size = match &stci {
Stci::Indexed { sub_images, .. } => sub_images
.get(0)
.ok_or_else(|| "indexed stci does not have at least one subimage".to_owned())
.map(|s| (u32::from(s.dimensions.0), u32::from(s.dimensions.1))),
Stci::Rgb { width, height, .. } => Ok((u32::from(*width), u32::from(*height))),
}?;
@selaux
selaux / keybase.md
Created May 24, 2020 07:36
keybase.md

Keybase proof

I hereby claim:

  • I am selaux on github.
  • I am selaux (https://keybase.io/selaux) on keybase.
  • I have a public key whose fingerprint is DCC7 60D1 0565 FD08 D681 B379 0811 39E8 4577 8986

To claim this, I am signing this object:

This file has been truncated, but you can view the full file.
these derivations will be built:
/nix/store/k1ww35ij6c9r0vxxrqpmid1lpmhpq3zm-nodejs-11.0.0.drv
building '/nix/store/k1ww35ij6c9r0vxxrqpmid1lpmhpq3zm-nodejs-11.0.0.drv'...
unpacking sources
unpacking source archive /nix/store/8z1ffbbh6l6a9rip5dl988h1rqdwanjp-node-v11.0.0.tar.xz
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
import os
import re
from shutil import copy2 as copy
from io import BytesIO
from subprocess import run, PIPE
from functools import partial
MAX_ITERS = 100000
MAKE_CMD = partial(run, ['make', '-j1'], stderr=PIPE)
BUILD_BOOST_BASE = './_build/lib-boost/'
@selaux
selaux / orphans.py
Last active May 29, 2016 16:16 — forked from renefritze/orphans.py
finds cpp files from given dir that are never included in given dir
#!/usr/bin/env python
import sys
import re
import pprint
import os
import fnmatch
headers = { 'cpp': ['*.h', '*.hh', '*.hpp'] }
sources = { 'cpp': ['*.c', '*.cpp', '*.cc']}
@selaux
selaux / gist:6cb430f9c641b79dfdb8
Created October 20, 2014 09:06
home-automation
#! /bin/sh
### BEGIN INIT INFO
# Provides: home-automation
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@selaux
selaux / PKGBUILD
Last active December 18, 2015 20:29
PKGBUILD for ck2launcher-gtk
# Maintainer: selaux <test@example.com>
pkgname=ck2launcher-gtk
pkgver=20130814
pkgrel=1
pkgdesc="GTK-based launcher for Crusader Kings 2, allowing to select Mods & DLC"
arch=('i686' 'x86_64')
url="https://gist.github.com/selaux/5840325"
license=('WTFPL')
makedepends=('wget')
depends=('python-gobject' 'python-appdirs')
@selaux
selaux / 800x600_svn46.patch
Created May 6, 2012 19:21
JA2 Stracciatella 800x600 Patch, Fixes
diff -Nru a/800x600MOD_changelog.txt b/800x600MOD_changelog.txt
--- a/800x600MOD_changelog.txt 1970-01-01 01:00:00.000000000 +0100
+++ b/800x600MOD_changelog.txt 2010-02-24 00:51:49.764757000 +0100
@@ -0,0 +1,22 @@
+Changelog of JA2 Stracciatella 800x600 Mod
+
+
+v0.04 Beta
+-----------------------------------------
+- Merged with the latest Stracciatella revision 7059