Skip to content

Instantly share code, notes, and snippets.

@mickm
mickm / main.cpp
Created Sep 13, 2019
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>
View gist:4161975cfe98d8d30179
#!/usr/bin/env node
var Png = require('png').Png; // https://github.com/pkrumins/node-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
mickm / gist:7832447
Created Dec 6, 2013
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/Terminal.app/Contents/MacOS/Terminal |grep adjustedRelative
colorForANSIColor:adjustedRelativeToColor:
colorForExtendedANSIColor:adjustedRelativeToColor:
%
@mickm
mickm / gist:6315020
Created Aug 23, 2013
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
View nginx.rb
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.6.tar.gz'
sha1 '432059b668e3f018eab61f99c7cc727db88464e8'
devel do
url 'http://nginx.org/download/nginx-1.3.10.tar.gz'
sha1 '11cd44bc0479594fd2e5f7a65bf8f2c36ad5ec1e'
@mickm
mickm / update-pingdom-iptables.sh
Created Nov 21, 2012
Whitelist Pingdom probe-servers in iptables.
View update-pingdom-iptables.sh
#!/bin/bash
#
# 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
mickm / 0-readme.md
Created May 27, 2012 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.
View 0-readme.md

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
mickm / top_terms.rb
Created Feb 24, 2012
Pull top site search terms and top search engine terms from GA
View top_terms.rb
#!/usr/bin/env ruby
GA_USER = 'foo@example.com'
GA_PASS = 'secrets!'
GA_PROPERTY = 'UA-8411317-51'
require 'rubygems'
require 'garb'
class SiteSearchTerms