This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
// Auto-generate carousel indicator html | |
var bootCarousel = $(".carousel"); | |
bootCarousel.append("<ol class='carousel-indicators'></ol>"); | |
var indicators = $(".carousel-indicators"); | |
bootCarousel.find(".carousel-inner").children(".item").each(function(index) { | |
(index === 0) ? | |
indicators.append("<li data-target='#MyCarousel' data-slide-to='" + index + "' class='active'></li>") : | |
indicators.append("<li data-target='#MyCarousel' data-slide-to='" + index + "'></li>"); | |
}); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body {font-family: Arial, Helvetica, sans-serif;} | |
/* The Modal (background) */ | |
.modal { | |
display: none; /* Hidden by default */ |
<?php | |
/** | |
* Plugin Name: Static Templates | |
* | |
* If most of your site content is in .php template files, and you're tired of | |
* creating new pages, assigning them page templates, creating page templates | |
* then doing it all over again on production, this plugin is for you. | |
* | |
* Examples: | |
* |
function the_slug($echo=true){ | |
$slug = basename(get_permalink()); | |
do_action('before_slug', $slug); | |
$slug = apply_filters('slug_filter', $slug); | |
if( $echo ) echo $slug; | |
do_action('after_slug', $slug); | |
return $slug; | |
} | |
// credit: http://www.tcbarrett.com/2011/09/wordpress-the_slug-get-post-slug-function/ |
var YQL = require('yql'); | |
var query = new YQL('select * from weather.forecast where (location = 94089)'); | |
query.exec(function(err, data) { | |
var location = data.query.results.channel.location; | |
var condition = data.query.results.channel.item.condition; | |
console.log('The current weather in ' + location.city + ', ' + location.region + ' is ' + condition.temp + ' degrees.'); | |
}); |
Get exchange rate as JSONP via YQL. | |
YQL Console: http://developer.yahoo.com/yql/console | |
Query (USD to SEK): select rate,name from csv where url='http://download.finance.yahoo.com/d/quotes?s=USDSEK%3DX&f=l1n' and columns='rate,name' | |
Example code: | |
<script type="text/javascript"> |
.slides-nav { | |
z-index: 99; | |
position: fixed; | |
right: -5%; | |
display: -webkit-box; | |
display: -ms-flexbox; | |
display: flex; | |
-webkit-box-align: center; | |
-ms-flex-align: center; | |
align-items: center; |
function isTouchDevice(){ | |
return true == ("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch); | |
} | |
if(!isTouchDevice() && window.outerWidth > 1199){ | |
} |
"use strict"; | |
/* A version number is useful when updating the worker logic, | |
allowing you to remove outdated cache entries during the update. | |
*/ | |
var version = 'v1::'; | |
/* These resources will be downloaded and cached by the service worker | |
during the installation process. If any resource fails to be downloaded, | |
then the service worker won't be installed either. |