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
| { | |
| "serviceLocationId": 60021, | |
| "sensorId": 1, | |
| "records": [ | |
| { | |
| "timestamp": 1615852800000 | |
| }, | |
| { | |
| "timestamp": 1615853700000 | |
| }, |
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
| { | |
| "lon": -0.6774620035007706, | |
| "lat": 51.354644775390625, | |
| "electricityCost": 0, | |
| "electricityCurrency": "GBP", | |
| "timezone": "Europe/London", | |
| "appliances": [ | |
| { | |
| "id": 2, | |
| "name": "Cooker", |
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
| { | |
| "timestamp": 1615849200000, | |
| "consumption": 40.983, | |
| "solar": 0, | |
| "alwaysOn": 83.016, | |
| "gridImport": 40.983, | |
| "gridExport": 0, | |
| "selfConsumption": 0, | |
| "selfSufficiency": 0, | |
| "active": [ |
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
| { | |
| "lon": -0.6774620035007706, | |
| "lat": 51.354644775390625, | |
| "electricityCost": 0, | |
| "electricityCurrency": "GBP", | |
| "timezone": "Europe/London", | |
| "appliances": [ | |
| { | |
| "id": 2, | |
| "name": "Cooker", |
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
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd |
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
| # This is a skeleton for testing models including examples of validations, callbacks, | |
| # scopes, instance & class methods, associations, and more. | |
| # Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
| # | |
| # I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
| # so if you have any, please share! | |
| # | |
| # @kyletcarlson | |
| # | |
| # This skeleton also assumes you're using the following gems: |
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
| .dead-center { | |
| height: 200px; | |
| width: 200px; | |
| position: absolute; | |
| top: 0; | |
| bottom: 0; | |
| left: 0; | |
| right: 0; | |
| margin: 0 auto; | |
| } |
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
| <% flash.each do |key, value| %> | |
| <div class="<%= flash_class(key) %>"> | |
| <%= value %> | |
| </div> | |
| <% end %> |
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
| class SessionsController < ApplicationController | |
| def create | |
| auth = request.env["omniauth.auth"] | |
| @identity = Identity.find_with_omniauth(auth) | |
| if @identity.nil? | |
| @identity = Identity.create_with_omniauth(auth) | |
| end | |
| if signed_in? |
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
| Sub OnChangeCopyUnderScenario(ByVal Target As Range, trigger_area As String, from_area As String, to_area As String, scenario_cell As String, scenario_value As Integer) | |
| 'Usage: OnChangeCopyUnderScenario(Target, "drivers area", "input area", "output area", "scenario cell", "scenario value") | |
| On Error GoTo ErrorHandler | |
| 'Dim | |
| Dim trigger_range As Range | |
| Set trigger_range = Range(trigger_area) | |
| If Not Application.Intersect(trigger_range, Target) Is Nothing Then |