This file contains 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 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 | |
* arduino0169@gmail.com | |
* https://www.youtube.com/watch?v=3bFs_MZVFxw | |
*/ |
This file contains 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 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 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 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 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 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 | |
// #1 We register LoadCss script, and we load it in the footer | |
// LoadCss is here -> https://github.com/filamentgroup/loadCSS/blob/master/src/loadCSS.js | |
add_action( 'wp_enqueue_scripts', 'register_my_scripts' ); | |
function register_my_scripts() { | |
wp_enqueue_script( 'loadCss', get_template_directory_uri() . '/js/libs/loadCss.js',false, '1.2.1', true ); | |
} |
This file contains 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
<!DOCTYPE html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> |
This file contains 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
// The lazyoad class is added | |
<?php the_post_thumbnail('medium', array('class' => "img-responsive lazyload")); ?> | |