bootstrap snippets
browser referesh
color highlighter(buggy)
indent xml
| // lib A | |
| Global Server; | |
| void on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); | |
| server->on("/", std::bind(&myClass::handler, this, handlerArg)); | |
| void myClass::handler(bool arg){ | |
| Server->blargh(); | |
| } |
| Jun 13 06:59:53 tasmota_C59B5E-7006 192.168.20.46 ESP-MQT: tele/tasmota_C59B5E/SENSOR = {"Time":"2021-06-13T06:59:52","ANALOG":{"CTEnergy":{"Energy":0.006,"Power":2068,"Voltage":230,"Current":8.992}},"DHT11":{"Temperature":23.0,"Humidity":37.0,"DewPoint":7.5},"TempUnit":"C"} | |
| Jun 13 06:59:53 tasmota_C59B5E-7006 192.168.20.46 ESP-MQT: tele/tasmota_C59B5E/STATE = {"Time":"2021-06-13T06:59:52","Uptime":"0T00:00:11","UptimeSec":11,"Heap":28,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"leela","BSSId":"F4:92:BF:7F:35:4B","Channel":3,"RSSI":30,"Signal":-85,"LinkCount":1,"Downtime":"0T00:00:05"}} | |
| Jun 13 06:59:51 tasmota_C59B5E-7006 192.168.20.46 ESP-APP: Boot Count 27 | |
| Jun 13 06:59:49 tasmota_C59B5E-7006 192.168.20.46 ESP-QPC: Reset | |
| Jun 13 06:59:49 tasmota_C59B5E-7006 192.168.20.46 ESP-MQT: stat/tasmota_C59B5E/STATUS10 = {"StatusSNS":{"Time":"2021-06-13T06:59:49","ANALOG":{"CTEnergy":{"Energy":0.004,"Power":2088,"Voltage":230,"Current":9.078}},"DHT11":{"Temperature": |
| // EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3 | |
| #include "EmonLib.h" // Include Emon Library | |
| #define VOLT_CAL 148.7 | |
| EnergyMonitor emon1; // Create an instance | |
| void setup() | |
| { |
| /* | |
| * aw9523.c aw9523 martix key | |
| * | |
| * Version: v1.0.1 | |
| * | |
| * Copyright (c) 2017 AWINIC Technology CO., LTD | |
| * | |
| * Author: Nick Li <liweilei@awinic.com.cn> | |
| * | |
| * This program is free software; you can redistribute it and/or modify it |
| //COMPILES | |
| #ifndef SOMEDEF | |
| void initstuff(){ | |
| } | |
| #endif | |
| #ifdef SOMEDEF | |
| void initstuff(){ | |
| } | |
| #endif |
| void scrollString(String str) { | |
| int yoff = 1; | |
| display.clearDisplay(); | |
| display.setTextWrap(false); // we don't wrap text so it scrolls nicely | |
| display.setTextSize(2); | |
| display.setRotation(0); | |
| int charWidth = 12; // textsize 2 @todo auto calculate charwidth from font | |
| int pxwidth = (str.length()*charWidth)+32; // @todo get actual string pixel length, add support to gfx if needed | |
| for (int32_t x=charWidth; x>=-pxwidth; x--) { |
| // typedef enum { | |
| // WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP to which the station is connected */ | |
| // WIFI_COUNTRY_POLICY_MANUAL, /**< Country policy is manual, always use the configured country info */ | |
| // } WIFI_COUNTRY_POLICY; | |
| // typedef struct { | |
| // char cc[3]; /**< country code string */ | |
| // uint8_t schan; /**< start channel */ | |
| // uint8_t nchan; /**< total channel number */ | |
| // uint8_t policy; /**< country policy */ |
| <script> | |
| // https://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery | |
| escaped = new Option(unescaped).innerHTML; | |
| var entityMap = { | |
| '&': '&', | |
| '<': '<', | |
| '>': '>', |
| <?php | |
| // why does print_r($xmlobj->node) only print the first node ? | |
| $string = <<<XML | |
| <breakfast_menu> | |
| <food> | |
| <name>Belgian Waffles</name> | |
| <price>$5.95</price> | |
| <description> | |
| Two of our famous Belgian Waffles with plenty of real maple syrup |