Skip to content

Instantly share code, notes, and snippets.

Avatar

Stephen Oliver steveatinfincia

View GitHub Profile
View gist:19e6fe2ac09a560c55c1a7ed0834fcc3
case MAVLINK_MSG_ID_PARAM_REQUEST_LIST: {
mavlink_param_request_list_t request;
mavlink_msg_param_request_list_decode(&msg, &request);
/* this is how you would load a setting for the component when
* replying to a settings request
*/
QSettings settings;
settings.beginGroup("OpenHDCamera");
View gist:bd3aa2aa4f5fb51044e917af13e9e7c5
QT_MAJOR_VERSION=5.13
QT_MINOR_VERSION=1
# fix broadcom opengl library names without breaking anything else
ln -sf /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libEGL.so
ln -sf /opt/vc/lib/libEGL.so /opt/vc/lib/libEGL.so.1
ln -sf /opt/vc/lib/libbrcmGLESv2.so /opt/vc/lib/libGLESv2.so
ln -sf /opt/vc/lib/libbrcmGLESv2.so /opt/vc/lib/libGLESv2.so.2
ln -sf /opt/vc/lib/libbrcmOpenVG.so /opt/vc/lib/libOpenVG.so
ln -sf /opt/vc/lib/libbrcmWFC.so /opt/vc/lib/libWFC.so
View picamera-live-change.py
import picamera
import subprocess
from time import sleep
proc = subprocess.Popen([
'/usr/bin/gst-launch-1.0',
'fdsrc', '!',
'h264parse', '!',
'rtph264pay', 'config-interval=1', 'pt=96', '!',
'udpsink', 'host=192.168.40.14', 'port=5600'
View gist:c75912fad911732f0debbfb1fec58a60
/*
* Author: Jurgen "PlantCorn" Schull <j.schull@plantcorn.com>
* I originally created this for a mode 2 controller (Turnigy 9xr Pro) as most of the other
* solutions available to me simply did not work or were too much of a pain.
* things such as smartpropro plus did not work at all for me, and out of frustration I
* created this. I calibrated the controller, and within minutes i was able to use my
* favorite sims, I hope this also works for you.
* Be sure to upload to your teensy in serial+keyboard+mouse+joych mode, 72mhz optimized
* i used a Teensy 3.1 with ppm input on pin 10 and ppm ground to GND
*/
View gist:5a3309d9fbb89f510666a6efaf9a1956
/* Complete USB Joystick Example
You must select Joystick from the "Tools > USB Type" menu and edit the Teensy headers to enable
the maxy axis joystick mode, otherwise some of the axis will not be available
*/
void setup() {
// you can print to the serial monitor while the joystick is active!
Serial.begin(115200);
// configure the joystick to manual send mode. This gives precise
// control over when the computer receives updates, but it does
View gist:22c5a92d4676fbea7d11334fa8aa542d
/* Complete USB Joystick Example
You must select Joystick from the "Tools > USB Type" menu and edit the Teensy headers to enable
the mega-joystick mode, otherwise some of the axis will not be available
*/
void setup() {
// you can print to the serial monitor while the joystick is active!
Serial.begin(115200);
// configure the joystick to manual send mode. This gives precise
// control over when the computer receives updates, but it does
View t.sh
install_name_tool -id "@rpath/libmy.dylib" dist-x86_64-apple-darwin/lib/libmy.dylib || true
clang -o test src/test.c -rpath dist-x86_64-apple-darwin/lib -Ldist-x86_64-apple-darwin/lib -Idist-x86_64-apple-darwin/include -lmy -O2
View t.rs
// error:
error[E0277]: the trait bound `mymodule::MyHeader: mymodule::reqwest::header::Header` is not satisfied
// in crate root
#[macro_use] extern crate hyper;
// original code in mymodule using header! macro from Hyper
extern crate reqwest;
View swift-nspredicate-example.swift
func search(words: [String]?) -> [Codepoint] {
guard let searchTerms = words else {
print("failed to unpack words")
return []
}
var predicates : [NSPredicate] = [NSPredicate]()
for term in searchTerms {
let codePredicate = NSPredicate(format: "(%@ IN[cd] code)", term)
let typePredicate = NSPredicate(format: "(%@ IN[cd] type)", term)
View steve@infincia.com-transition-2016-01-03.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I am transitioning my gpg key from a 2048-bit RSA key to a new
4096-bit RSA key.
The new key is signed by the old key, and this transition document
is signed with both keys.