by @jpettitt, updated: 2021-05-20
The Daily Planet. Superman
The Metropolis Star. Superman
The Sheepdog Times. Seb
The Gotham Gazette. Batman
views: | |
- title: Live Energy Data | |
path: test | |
type: custom:grid-layout | |
layout: | |
grid-template-columns: 50% 50% | |
card_margin: 0 0 0 0 | |
margin: 0 | |
grid-template-rows: auto | |
grid-template-areas: | |
# Uses Apex-Charts (install from HACS) | |
# Define an Apex Charts template in the main view YAML | |
# Saves repeating it for every sensor | |
apexcharts_card_templates: | |
color_temp: | |
# Install card mod and adjust font size accounding to taste or just remove | |
card_mod: | |
style: | | |
ha-card { | |
font-size: 16px |
# UPS runtime in hh:mm:ss | |
# converts run time to seconds since unix epoc 1970-01-10T00:00Z | |
# to do this it uses this to get the locale time offset | |
# 0 | timestamp_custom('%s') | float | |
- platform: template | |
sensors: | |
server_rack_ups_runtime_mins: | |
friendly_name: "Server Rack UPS Runtime" | |
value_template: >- | |
{{ (states.sensor.server_rack_battery_runtime.state | float - (0 | timestamp_custom('%s') | float)) | timestamp_custom('%X') }} |
# T-Mobile Internet | |
# | |
# TMobile Home Internet Sensors | |
# Arcadyan Router | |
# | |
- platform: rest | |
# All of these seem to use the same IP | |
resource: http://192.168.12.1/TMI/v1/gateway?get=all | |
scan_interval: 60 |
by @jpettitt, updated: 2021-05-20
The Daily Planet. Superman
The Metropolis Star. Superman
The Sheepdog Times. Seb
The Gotham Gazette. Batman
I hereby claim:
To claim this, I am signing this object:
<!doctype html> | |
<html ⚡> | |
<head> | |
<meta charset="utf-8"> | |
<title>amp-bind</title> | |
<link rel="canonical" href="https://ampbyexample.com/components/amp-bind/"> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | |
<script async src="https://cdn.ampproject.org/v0.js"></script> | |
<script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script> |
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
var url = require('url'); | |
var qs = require('qs'); | |
var assert = require('assert') | |
var parsed = url.parse('http://www.example.com/somepath?x=1'); | |
var parsedQuery = qs.parse(parsed.query); | |
assert.deepEqual(parsedQuery, { x: 1 }); |
/* | |
* Copy and paste into browser console to find out how many classes, ids and nodes a page actually uses | |
*/ | |
function countClass() { | |
const elements = document.querySelectorAll('*'); | |
const ids = {}; | |
const classes= {}; | |
const nodes = {} | |