This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Servo.h> | |
| #include <SPI.h> | |
| #include <Ethernet.h> | |
| #include <PusherClient.h> | |
| byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
| PusherClient client; | |
| int ledPin = 13; // LED connected to digital pin 13 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "awesome_print" | |
| require 'json' | |
| list = [ | |
| "compass-config.rb", | |
| "config.yaml", | |
| "content/00_home/00_index.md", | |
| "content/00_home/01_work.md", | |
| "content/01_additional services/00_index.md", | |
| "content/01_additional services/01_writing labs.md", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| positions = %w( | |
| reset_password_mail | |
| registration_mail | |
| welcome_mail | |
| newsletter | |
| ) | |
| class Prioritize | |
| def initialize(positions) | |
| positions.each do |position| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1234136 | |
| 1234149 | |
| 1234162 | |
| 1234175 | |
| 1234188 | |
| 1234201 | |
| 1234214 | |
| 1234227 | |
| 1234239 | |
| 1234252 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "result" : [ | |
| { | |
| "_id" : { | |
| "year" : 2014, | |
| "month" : 3, | |
| "day" : 11, | |
| "hour" : 23 | |
| }, | |
| "wh" : 1247628 | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "result" : [ | |
| { | |
| "_id" : 22, | |
| "wh" : 1246489 | |
| }, | |
| { | |
| "_id" : 23, | |
| "wh" : 1247302 | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { "_id" : ObjectId( "53203555666661072f9f0500" ), | |
| "meter_id" : 1, | |
| "timestamp" : Date( 1394668740000 ), | |
| "wh" : 1247628 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.measurements.aggregate([ | |
| { "$match" : { "timestamp": { "$gte": ISODate('2014-03-12 00:00:00'), "$lt": ISODate('2014-03-12 23:59:59') } } }, | |
| { "$project": { | |
| "wh": 1, | |
| "hourly": { "$hour": "$timestamp" } | |
| }}, | |
| { "$sort": { "hourly": 1 } }, | |
| { "$group": { | |
| "_id": "$hourly", | |
| "firstReading": { "$first": "$wh" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > db.measurements.find() | |
| { "_id" : ObjectId("53203553666661072f000000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:00:00Z"), "wh" : 1234136 } | |
| { "_id" : ObjectId("53203553666661072f010000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:01:00Z"), "wh" : 1234149 } | |
| { "_id" : ObjectId("53203553666661072f020000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:02:00Z"), "wh" : 1234162 } | |
| { "_id" : ObjectId("53203553666661072f030000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:03:00Z"), "wh" : 1234175 } | |
| { "_id" : ObjectId("53203553666661072f040000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:04:00Z"), "wh" : 1234188 } | |
| { "_id" : ObjectId("53203553666661072f050000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:05:00Z"), "wh" : 1234201 } | |
| { "_id" : ObjectId("53203553666661072f060000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:06:00Z"), "wh" : 1234214 } | |
| { "_id" : ObjectId("53203553666661072f070000"), "meter_id" : 1, "timestamp" : ISODate("2014-03-12T00:07 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include_recipe 'ruby_build' | |
| file "/etc/gemrc" do | |
| content <<-EOS | |
| install: --no-rdoc --no-ri | |
| update: --no-rdoc --no-ri | |
| EOS | |
| owner "root" | |
| mode 0644 |