Skip to content

Instantly share code, notes, and snippets.

@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 / Basic_ruby_oracle_demo.rb
Last active March 25, 2020 14:51
Using the OCI8, Sequel, and ruby_plsql gems all together
#!/usr/bin/env ruby
# Simplified demo showing the use of the Sequel gem, raw OCI8 connection, and
# ruby_plsql gem on a single connection. Uses undocumented yield behavior from
# Sequel, so might not work with different Sequel versions.
# by Mike Bourgeous
# These must be set before requiring oci8
ENV['NLS_LANG'] = 'american_america.utf8'
ENV['TNS_ADMIN'] = File.expand_path(File.dirname(__FILE__))
@mike-bourgeous
mike-bourgeous / popen3_2007.c
Last active May 13, 2022 06:35 — forked from nitrogenlogic/00_popen3_moved.md
Two implementations of a popen3() function in POSIX/C providing stdin, stdout, and stderr (http://blog.mikebourgeous.com/2011/06/12/programmatic-process-control-in-c-popen3/)
/*
* This implementation of popen3() was created in 2007 for an experimental
* mpg123 frontend and is based on a popen2() snippet found online. This
* implementation may behave in unexpected ways if stdin/stdout/stderr have
* been closed or modified. No warranty of its correctness, security, or
* usability is given. My modifications are released into the public domain,
* but if used in an open source application, attribution would be appreciated.
*
* Mike Bourgeous
* https://github.com/mike-bourgeous
@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