Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Phillips PharkMillups

  • Helium
  • Boston / San Francisco
View GitHub Profile
View gist:9ce8b9c5b0d84c9ad6cba5ced84f803a
void
loop()
{
//Create Json object with buffer to match data size
StaticJsonBuffer<JSON_OBJECT_SIZE(2) + 35> jsonBuffer;
JsonObject & root = jsonBuffer.createObject();
root[F("interval")] = send_interval; //JSON MESSAGE
char buffer[HELIUM_MAX_DATA_SIZE];
size_t used = root.printTo(buffer, HELIUM_MAX_DATA_SIZE);
View basic.ino
/*
* Copyright 2017, Helium Systems, Inc.
* All Rights Reserved. See LICENCE.txt for license information
*/
#include "Arduino.h"
#include "Board.h"
#include "Helium.h"
#include "HeliumUtil.h"
View gist:1ae0d44fba64053c478ddbc1a5d3af39
### Keybase proof
I hereby claim:
* I am pharkmillups on github.
* I am themarkphillips (https://keybase.io/themarkphillips) on keybase.
* I have a public key ASBYZtj0kDhPbhXLsGtT5BKb3qokovBx_WB0aTIae4AyzQo
To claim this, I am signing this object:
View heliumapi.md

A Simple Helium API Challenge

Build a chart or two using the sensor data sources coming out of @pharkmillups' condo and Helium's beta HTTP API. The first five entries will be in line for some limited edition Helium swag.

Here are all the details you'll need:

  • Full API Docs: https://docs.helium.com/api
  • Available Data Streams: udXeI0fPTnajUSfsgZz_Fg & NEr1iiOKRlqWS7EBS6l8Qw
  • API Token: f4rcAI9eEhLOPNu+WQmN25r5tARvvD2+b2LxIyi0o3Q=
@PharkMillups
PharkMillups / pbc.sh
Created July 29, 2013 22:51
Riaks Counters vis PBC API
View pbc.sh
// Counter update request
message RpbCounterUpdateReq {
required bytes bucket = 1;
required bytes key = 2;
required sint64 amount = 3;
optional uint32 w = 4;
optional uint32 dw = 5;
optional uint32 pw = 6;
optional bool returnvalue = 7;
View gist:6108587
// Create a new bucket in Riak and enable `allow_mult`
$ curl -i http://localhost:8098/buckets/new_hotness/props \
-X PUT -d '{"props":{"allow_mult":true}}' -H "Content-Type: application/json"
// POST to the `counters` resource. In this example we're adding "1" to the "riak-counters-blog-post-views" counter
$ curl -i http://localhost:8098/buckets/new_hotness/counters/riak-counters-blog-post-views \
-X POST -d "1"
@PharkMillups
PharkMillups / gist:5630223
Last active December 17, 2015 15:18
Crispy Tailors in San Francisco
View gist:5630223
View gist:4067319
db.getBucket('airlines', function(err, properties) {
  console.log(properties.dw);

});

View gist:4067316
db.search.add('airlines', {id: 'Lufthansa', country: 'DE'});

db.search.find('airlines', 'country:DE');

View gist:4067313
var db = require('riak-js').getClient();

db.mapreduce.add('airlines').map('Riak.mapValuesJson').run();