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
| # Gzip compression | |
| <IfModule mod_deflate.c> | |
| # Active compression | |
| SetOutputFilter DEFLATE | |
| # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ | |
| <IfModule mod_setenvif.c> | |
| <IfModule mod_headers.c> | |
| SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding | |
| RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding |
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
| <?php | |
| /* | |
| function to add async and defer attributes | |
| Will only work if the scripts are enqueued with wp_enqueue_script() | |
| */ | |
| function defer_js_async($tag){ | |
| ## 1: list of scripts to defer. | |
| $scripts_to_defer = array( | |
| 'owl-carousel.min.js', |
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
| <!-- Put this function inline on the header --> | |
| <script> | |
| function whenAvailable(name, callback) { | |
| var interval = 10; // ms | |
| window.setTimeout(function() { | |
| if (window[name]) { | |
| callback(window[name]); | |
| } else { | |
| window.setTimeout(arguments.callee, interval); | |
| } |
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
| # | |
| # Gzip Config | |
| # | |
| gzip on; | |
| gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | |
| # | |
| # Browser Caching config | |
| # | |
| location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { |
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
| var dataBase = require('./db.js'); | |
| /* | |
| * Instatiations | |
| */ | |
| var db = new dataBase(); | |
| try { |
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
| /* | |
| * ESP8266 (WeMosD1) WiFi Relay Control | |
| * | |
| * learnelectronics | |
| * 05 JUN 2017 | |
| * | |
| * www.youtube.com/c/learnelectronics | |
| * [email protected] | |
| * https://www.youtube.com/watch?v=3bFs_MZVFxw | |
| */ |
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 <ESP8266WiFi.h> | |
| #include <WiFiClient.h> | |
| #include <ESP8266WebServer.h> | |
| #include <ESP8266mDNS.h> | |
| const char* ssid = "myWifiSSID"; | |
| const char* password = "myWifiPassWord"; | |
| ESP8266WebServer server(80); |
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
| var pin = NodeMCU.D2; | |
| var dht = require("DHT22").connect(pin); | |
| var data = {}; | |
| setInterval( () =>{ | |
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
| abGAsendTime = function(){ | |
| this.getLoadTime = function() { | |
| return performance.timing.loadEventStart - performance.timing.navigationStart; | |
| } | |
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
| void callback(char* topic, byte* payload, unsigned int length) { | |
| Serial.print("Message arrived ["); | |
| Serial.print(topic); | |
| char message[length + 1]; | |
| // copy contents of payload to message | |
| memcpy(message, payload, length); |