Skip to content

Instantly share code, notes, and snippets.

@mike-bourgeous
mike-bourgeous / posterous_import.rb
Created October 23, 2016 00:43 — forked from nitrogenlogic/00_posterous_import_moved.md
This quick and dirty script imports posts and images exported by the Posterous backup feature into Octopress. Requires the escape_utils and nokogiri gems. Doesn't import comments. See comments below the gist for more instructions.
#!/usr/bin/env ruby
# This quick and dirty script imports posts and images exported by the
# Posterous backup feature into Octopress. Requires the escape_utils and
# nokogiri gems. Doesn't import comments.
#
# Videos and images are copied into a post-specific image directory used
# by my customized Octopress setup. Encoded videos are downloaded from
# Posterous. Images will probably need to be compressed/optimized afterward.
#
# Links to other posts in the same import will try to be converted. You will
@mike-bourgeous
mike-bourgeous / swap_stderr.sh
Created October 23, 2016 00:45 — forked from nitrogenlogic/00_swap_stderr_moved.md
Swap stdout and stderr, log stderr to a file (BASH)
#!/bin/bash
test() {
echo "Standard out"
echo "Standard error" >&2
}
tmpfile=`mktemp`
test 3>&1 4>&2 2>&3- 1>&4- | tee $tmpfile
cat $tmpfile
@mike-bourgeous
mike-bourgeous / 00info.md
Created September 13, 2019 00:45
SIGSEGV from JRuby and jnr-ffi / jnr-posix / jnr-enxio on Java 11
@mike-bourgeous
mike-bourgeous / standalone_readpixels.c
Last active October 8, 2022 23:23
Linux and GLX example of fast glReadPixels with PBOs
/*
* Minimal Linux- and GLX-specific example of using a pool of Pixel Buffer
* Objects to stream pixel data.
*
* This is a minimal test case for opening an OpenGL window with raw
* X11/Xlib/GLX, drawing a simple test image, and fast PBO-based streaming of
* image data to disk with glReadPixels().
*
* On an NVidia RTX2080 Super, on Ubuntu 20.04, saving to an SSD, this sustains
* 150+fps (peaking at 500+, hitting 900+ if only writing a single file instead