Skip to content

Instantly share code, notes, and snippets.

@tkurki
tkurki / gist:8878068
Created February 8, 2014 07:39
Sed oneliner to convert markup to d3 append/attr commands. Not terribly pretty, but helps with tedious conversions.
cat | sed 's/\<\([a-z]*\)/append("\1")/' | sed 's/ \([a-z]*\)="/.attr("\1","/g' | sed 's/"\.att/"\)\.att/g'
@tkurki
tkurki / gist:9066012
Created February 18, 2014 07:14
ElasticSearch 0.90.7 client problem
"elasticsearch[Stem Cell][generic][T#8]" daemon prio=10 tid=0x00007f590800b000 nid=0x5ce0 waiting for monitor entry [0x00007f59610ba000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Throwable.java:783)
- locked <0x00000000e07f1548> (a org.elasticsearch.transport.NodeNotConnectedException)
at java.lang.Throwable.<init>(Throwable.java:287)
at java.lang.Exception.<init>(Exception.java:84)
at java.lang.RuntimeException.<init>(RuntimeException.java:80)
at org.elasticsearch.ElasticSearchException.<init>(ElasticSearchException.java:46)
at org.elasticsearch.transport.TransportException.<init>(TransportException.java:34)
@tkurki
tkurki / gist:70fe3c6407cba5a266a4
Created January 12, 2015 05:59
SignalK provider configuration for actisense-serial
{
"vessel": {
"name": "your boat name",
"uuid": "000000000"
},
"pipedProviders": [{
"id": "actisense",
"pipeElements": [{
"type": "providers/execute",
@tkurki
tkurki / gist:2127adf7f4168c6584da
Created January 12, 2015 19:21
Signalk provider configuration for actisense-serial with raw input logged to file as well
{
"vessel": {
"name": "your boat name",
"uuid": "000000000"
},
"pipedProviders": [{
"id": "actisense",
"pipeElements": [{
"type": "providers/execute",
"options": {
//java, the main part of my processor.
/*
* {
"timestamp": "2013-10-08-15:47:28.264",
"prio": "2",
"src": "2",
"dst": "255",
"pgn": "129025",
"description": "Position, Rapid Update",
@tkurki
tkurki / gist:18636ed16f8845ec9b53
Last active August 29, 2015 14:14
Bacon + React
var BaconValue = React.createClass({
getInitialState: function() {
return {value: '-'};
},
render: function() {
return (
<div>{this.state.value}</div>
)
},
componentDidMount: function() {
var WebSocket = require('ws')
var url = "ws://" + "localhost:3000" + "/signalk/stream/v1?stream=delta";
var count = 0;
var connection = new WebSocket(url);
connection.onopen = function(msg) {
console.log("open")
var sub = '{"context":"vessels.self","subscribe":[{"path":"*"}]}';
connection.send(sub);
@tkurki
tkurki / README.md
Last active September 26, 2016 07:23
Paste this script to your browser, interact with your SPA and get feedback on how much time it spends blocking the JavaScript event loop eg. executing JavaScript. Then optimize & compare output before & after.
@tkurki
tkurki / gist:84cd71d2329f3ffae9f0
Last active November 23, 2015 11:09
Signal K sample (multiple values)
{
"uuid": "10101011",
"navigation": {
"speedThroughWater": {
"value": 3.2444444444444445,
"sentence": "VHW",
"$source": "nmea2.II",
"timestamp": "2015-11-15T14:37:32.306Z",
"values": {
"nmea1.II": {