Skip to content

Instantly share code, notes, and snippets.

mickm / main.cpp
Created September 13, 2019 16:19
astra fps test case
View main.cpp
// usage:
// run this with the mini and stereo s and compare the fps in different light conditions
// the fps will drop on the stereo s in low light
// the mini maintains 30 fps in all lighting conditions
// seems like the autoexposure works differently (aperture priority vs shutter priority maybe?) on the stereo s vs the mini
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <astra/capi/astra.h>
mickm / gist:4161975cfe98d8d30179
Created April 16, 2015 18:17
rgba -> png example
View gist:4161975cfe98d8d30179
#!/usr/bin/env node
var Png = require('png').Png; //
var fs = require('fs');
var size = 256;
var rgba = new Buffer(size*size*4);
var x, y;
var png;
View gist:282608229c7a54bbc464
* bits - pretty-print bits from a hex/dec/oct input
* cc -ansi -pedantic -Wall -o bits bits.c
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
mickm / gist:7832447
Created December 6, 2013 21:31
dump tables, sequences, indices, constraints and data (no languages, functions, types, etc.)
View gist:7832447
pg_dump --no-owner --no-privileges $(paste -sd\ <(echo '\dt' |psql -At |awk -F\| '{print $2}' |egrep -v '^(spatial_ref_sys|geometry_columns)$' |xargs -n 1 echo -t))
View gist:6566095
% strings /Applications/Utilities/ |grep adjustedRelative
mickm / gist:6315020
Created August 23, 2013 02:41
ARM auto-vectorization gcc flags
View gist:6315020
# -O3 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant
mickm / nginx.rb
Last active December 12, 2015 04:38
View nginx.rb
require 'formula'
class Nginx < Formula
homepage ''
url ''
sha1 '432059b668e3f018eab61f99c7cc727db88464e8'
devel do
url ''
sha1 '11cd44bc0479594fd2e5f7a65bf8f2c36ad5ec1e'
mickm /
Created November 21, 2012 20:21
Whitelist Pingdom probe-servers in iptables.
# Whitelist Pingdom probe-servers in iptables.
# Create a chain called "PINGDOM" and jump to it somewhere before
# the final REJECT/DROP, e.g.
# # New chain for Pingdom rules
# :PINGDOM - [0:0]
mickm /
Created May 27, 2012 18:02 — forked from sj26/
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

mickm / top_terms.rb
Created February 24, 2012 15:27
Pull top site search terms and top search engine terms from GA
View top_terms.rb
#!/usr/bin/env ruby
GA_USER = ''
GA_PASS = 'secrets!'
GA_PROPERTY = 'UA-8411317-51'
require 'rubygems'
require 'garb'
class SiteSearchTerms