Skip to content

Instantly share code, notes, and snippets.

View GreenRover's full-sized avatar

Heiko Henning GreenRover

  • mtrail.ch
  • Bern Switzerland
View GitHub Profile
<?php
class Singelton extends ArrayObject {
private static $_registry = null;
public static function getInstance() {
if (self::$_registry === null) {
self::$_registry = new Singelton();
}
@GreenRover
GreenRover / demo.csv
Last active August 29, 2015 14:22
Huge data store performance compare
We can't make this file beautiful and searchable because it's too large.
MACHINE_IDENTIFIER;cfg;"RUB20:_Energie:Zähler:Bezug Total"
CLASS;cfg;"CounterUp"
UNIT;cfg;"kWh"
1190756700;x;0.000000000000000
1190757600;x;0.122685185185190
1190758500;x;0.245370370370370
1190759400;x;0.368055555555560
1190760300;x;0.490740740740740
1190761200;x;0.613425925925930
@GreenRover
GreenRover / not working example 001
Created May 28, 2015 18:39
Cassandra aggragation trigger
update sensor_data_aggregated_hour_min
set min_value=sensor_data.value,
min_timestamp=sensor_data.timestamp
where
sensor=sensor_data.sensor
and aggregation='hour'
and timestamp=DATE_FORMAT(sensor_data.timestamp, '%Y-%m-%d %H:00:00+0200');
if sensor_data.value<min_value;
update sensor_data_aggregated_hour_max