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>"); | |
}); |
<?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"> |
"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. |
[data-slides] { | |
background-image: url(../../uploads/banner1.jpg); /* Default image. */ | |
background-repeat: no-repeat; | |
background-position: center center; | |
background-size: cover; | |
-webkit-transition: all 0.7s ease; | |
-moz-transition: all 0.7s ease; | |
-ms-transition: all 0.7s ease; | |
-o-transition: all 0.7s ease; | |
transition: all 0.7s ease; |