Skip to content

Instantly share code, notes, and snippets.

@madninja
madninja / helium sensor timeseries format
Created July 23, 2016 14:45
helium sensor timeseries format
$ helium --format csv sensor timeseries list 3df4e2e0 --page-size 5
id,timestamp,port,value
23ae1672,2016-07-20T15:12:38.753Z,h,49.09123
608ff892,2016-07-20T15:12:38.752Z,p,100543.76
e0e2062b,2016-07-20T15:12:38.502Z,t,21.72662
04996299,2016-07-20T15:12:38.01Z,l,0
201b3388,2016-07-20T15:07:38.501Z,h,48.81309
@madninja
madninja / helium sensor timeseries date filter
Created July 23, 2016 14:44
helium sensor timeseries date filter
$ helium sensor timeseries list 3df4e2e0 --port t --start 2016-07-19 --end 2016-07-20
+----------+--------------------------+------+-----------+
| ID | TIMESTAMP | PORT | VALUE |
+----------+--------------------------+------+-----------+
| 8d1a380a | 2016-07-19T23:57:38.814Z | t | 22.39506 |
| 2e9eb8a1 | 2016-07-19T23:52:38.811Z | t | 22.384932 |
... snipped ...
| d147e55b | 2016-07-19T22:27:38.694Z | t | 22.298845 |
@madninja
madninja / helium sensor timeseries port-filter
Created July 23, 2016 14:43
helium sensor timeseries port-filter
$ helium sensor timeseries list 3df4e2e0 --port t --page-size 5
+----------+--------------------------+------+-----------+
| ID | TIMESTAMP | PORT | VALUE |
+----------+--------------------------+------+-----------+
| e0e2062b | 2016-07-20T15:12:38.502Z | t | 21.72662 |
| 33839612 | 2016-07-20T15:07:38.499Z | t | 21.711428 |
| df1e5df6 | 2016-07-20T15:02:38.496Z | t | 21.72662 |
| 9441b2cd | 2016-07-20T14:57:38.734Z | t | 21.706364 |
| 99deb177 | 2016-07-20T14:52:38.731Z | t | 21.711428 |
+----------+--------------------------+------+-----------+
$ helium sensor timeseries list 3df4e2e0 --page-size 5
+----------+--------------------------+------+-----------+
| ID | TIMESTAMP | PORT | VALUE |
+----------+--------------------------+------+-----------+
| 23ae1672 | 2016-07-20T15:12:38.753Z | h | 49.09123 |
| 608ff892 | 2016-07-20T15:12:38.752Z | p | 100543.76 |
| e0e2062b | 2016-07-20T15:12:38.502Z | t | 21.72662 |
| 04996299 | 2016-07-20T15:12:38.01Z | l | 0 |
| 201b3388 | 2016-07-20T15:07:38.501Z | h | 48.81309 |
+----------+--------------------------+------+-----------+
@madninja
madninja / helium sensor timeseries list
Last active July 23, 2016 14:40
helium sensor timeseries list
$ helium sensor timeseries list 3df4e2e0
+----------+--------------------------+------+------------+
| ID | TIMESTAMP | PORT | VALUE |
+----------+--------------------------+------+------------+
| f8a16bf0 | 2016-07-20T14:42:38.966Z | t | 21.691172 |
| 7fb52c99 | 2016-07-20T14:42:38.474Z | l | 0 |
| 0a073cec | 2016-07-20T14:42:38.217Z | h | 48.738995 |
| 6a46ce91 | 2016-07-20T14:42:38.216Z | p | 100527.414 |
| 739fcdf4 | 2016-07-20T14:37:38.965Z | h | 49.67008 |
| ffce8dd6 | 2016-07-20T14:37:38.964Z | p | 100525.37 |
@madninja
madninja / helium sensor list
Last active July 23, 2016 14:38
helium sensor list
$ helium sensor list
+----------+------------------+-------+-----------------------------+-----------------------------+
| ID | MAC | TYPE | SEEN | NAME |
+----------+------------------+-------+-----------------------------+-----------------------------+
| 5be9b35b | 6081f9fffe0006db | green | 2016-06-20T22:56:42.477678Z | Mobile Demo Green 1 |
| 94683401 | 6081f9fffe000665 | green | 2016-06-24T00:07:02.391306Z | Mobile Demo Green 3 |
| 445d5235 | 6081f9fffe000659 | blue | 2016-07-20T14:14:52.000829Z | Mini Fridge 4 |
| cb396f82 | 6081f9fffe0007eb | blue | 2016-07-20T14:45:53.276475Z | Mini Fridge 3 |
| ec76206d | 6081f9fffe0006aa | blue | 2016-06-29T18:21:04.302722Z | Mini Fridge 1.1 |
| 3df4e2e0 | 6081f9fffe000695 | green | 2016-07-20T14:43:57.481842Z | Mobile Demo Green 2 |

Keybase proof

I hereby claim:

  • I am madninja on github.
  • I am madninja (https://keybase.io/madninja) on keybase.
  • I have a public key whose fingerprint is E2DA 19A1 7067 6DA2 0001 AF44 9AAF AE1B C81C 42CD

To claim this, I am signing this object:

@madninja
madninja / UIColor+RGBExtensions.h
Created December 23, 2011 17:13
UIColor+RGBExtensions
static __inline UIColor *RGBXA(NSUInteger rgb, CGFloat alpha)
{
return [UIColor colorWithRed:((float)((rgb & 0xFF0000) >> 16))/255.0
green:((float)((rgb & 0xFF00) >> 8))/255.0
blue:((float)(rgb & 0xFF))/255.0
alpha:alpha];
}
static __inline UIColor *RGBX(NSUInteger rgb)
{
@madninja
madninja / CGGradientUtils.m
Created October 3, 2011 15:41
CGGradientUtils
CGGradientRef CGGradientCreateWithUIColors(CGColorSpaceRef space, NSArray *colors, const CGFloat locations[])
{
NSMutableArray *cgColors = [NSMutableArray arrayWithCapacity:colors.count];
[colors enumerateObjectsUsingBlock:^(UIColor *color, NSUInteger idx, BOOL *stop) {
[cgColors addObject:(id)color.CGColor];
}];
return CGGradientCreateWithColors(space, (CFArrayRef)cgColors, locations);
}
@madninja
madninja / UIColor+RGBExtensions.h
Created September 26, 2011 22:54
UIColor RGBExtensions
#import <UIKit/UIColor.h>
@interface UIColor (RgbExtensions)
+(UIColor *)rgbColorWithRed:(CGFloat)r green:(CGFloat)g blue:(CGFloat)b;
+(UIColor *)rgbaColorWithRed: (CGFloat)r green:(CGFloat)g blue:(CGFloat)b alpha:(CGFloat)a;
@end