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
async function addToCache(urls) { | |
const pageCache = await window.caches.open('page-cache'); | |
await pageCache.addAll(urls); | |
} | |
// Check that service workers are registered | |
if ('serviceWorker' in navigator) { | |
// Use the window load event to keep the page load performant | |
window.addEventListener('load', () => { | |
addToCache(['/hello-world/', '/main-page/']); |
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 | |
/** | |
* Enqueue scripts and styles. | |
* | |
* @since 1.0.0 | |
*/ | |
function ja_global_enqueues() { | |
wp_enqueue_style( | |
'jquery-auto-complete', |
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 | |
/* | |
For a better understanding of ics requirements and time formats | |
please check https://gist.github.com/jakebellacera/635416 | |
*/ | |
// UTILS | |
// Check if string is a timestamp |
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 | |
/* JUST ADD THIS CODE TO YOUR THEMES functions.php */ | |
/* Customize the last half, the output half to suit your projects needs */ | |
add_filter('post_gallery', 'my_post_gallery', 10, 2); | |
function my_post_gallery($output, $attr) { | |
global $post; | |
if (isset($attr['orderby'])) { | |
$attr['orderby'] = sanitize_sql_orderby($attr['orderby']); |
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 | |
# This file contains functions that are related with videos | |
# | |
# Filters/resizes video embed codes. | |
# | |
function filter_video($html, $wmode = false, $width = false, $height = false) { | |
$final_html = $html; | |
if ($wmode) { | |
if (strpos($final_html, 'iframe') !== FALSE && strpos($final_html, 'youtube') !== FALSE) { |
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
/** | |
* jQuery Masonry v2.1.01 | |
* A dynamic layout plugin for jQuery | |
* The flip-side of CSS Floats | |
* http://masonry.desandro.com | |
* | |
* Licensed under the MIT license. | |
* Copyright 2011 David DeSandro | |
*/ | |
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
/* | |
* Water Canvas by Almer Thie (http://code.almeros.com). | |
* Description: A realtime water ripple effect on an HTML5 canvas. | |
* Copyright 2010 Almer Thie. All rights reserved. | |
* | |
* Example: http://code.almeros.com/code-examples/water-effect-canvas/ | |
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript | |
*/ | |
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 | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |