Skip to content

Instantly share code, notes, and snippets.

View rayjanwilson's full-sized avatar
🦄

Rayjan Wilson rayjanwilson

🦄
View GitHub Profile
@rayjanwilson
rayjanwilson / load.js
Created February 23, 2018 18:27
example node.js load test script
#!/usr/bin/env node
/*
Load test an api endpoint using sample json input data from a file. Sample json file should be one json string per line.
./load.js -c 2 -t 5 --rps 5 https://APIGATEWAYENDPOINT.execute-api.us-east-1.amazonaws.com/Prod/
-c concurrency
-t load test duration in seconds
--rps requests per second

Enable USB-Ethernet bridging

  • connect to edison via the console, not ssh
  • build bridge-utils
    • wget http://sourceforge.net/projects/bridge/files/bridge/bridge-utils-1.5.tar.gz
    • wget http://www.linuxfromscratch.org/patches/blfs/svn/bridge-utils-1.5-linux_3.8_fix-1.patch
    • patch -Np1 -i ../bridge-utils-1.5-linux_3.8_fix-1.patch && autoconf -o configure configure.in && ./configure --prefix=/usr && make
var MAVLink, MavParams, SerialPort, UavConnection, attachDataEventListener, config, connection, dataEventName, dgram, fs, gcsSysId, glob, hasConnected, heartbeatMonitor, isAttached, isConnected, lastError, lastHeartbeat, latestBinaryLog, log, lostConnection, moment, net, os, protocol, receivedBinaryLog, sendHeartbeatInterval, sentBinaryLog, started, timeSinceLastHeartbeat, uavComponentId, uavSysId, util, _;
UavConnection = function(configObject, protocolParser, logObject) {
"use strict";
var config, log, protocol;
_.bindAll(this, "closeConnection", "handleDataEvent", "changeState", "heartbeat", "invokeState", "start", "getState", "updateHeartbeat", "disconnected", "connecting", "connected", "write");
log = logObject;
config = configObject;
protocol = protocolParser;
this.state = "disconnected";
return this.startLogging();
// woot.js
var say_woot = function(){
console.log('woot!');
};
exports.woot = woot;
@rayjanwilson
rayjanwilson / example for changing OL key handlers
Created March 15, 2012 10:09
possible solution to openlayers shift-click-drag issue
var map;
function init() {
map = new OpenLayers.Map('map',
{
'controls':[]
});
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{