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
<ifModule mod_headers.c> | |
Header always set Content-Security-Policy "upgrade-insecure-requests;" | |
</IfModule> |
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
<VirtualHost *:443> | |
# ... | |
RequestHeader set X-Forwarded-Proto "https" | |
RequestHeader set X-Forwarded-Port "443" | |
# ... | |
</VirtualHost> |
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
SET @oldurl='http://www.oldurl.com'; | |
SET @newurl='http://www.newurl.com'; | |
UPDATE wp_options SET option_value = replace(option_value, @oldurl, @newurl) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, @oldurl, @newurl); | |
UPDATE wp_posts SET post_content = replace(post_content, @oldurl, @newurl); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldurl, @newurl); |
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 CACHE_NAME = 'example-cache-v1'; | |
var urlsToCache = []; | |
self.addEventListener('install', function(event) { | |
// Perform install steps | |
event.waitUntil( | |
caches.open(CACHE_NAME) | |
.then(function(cache) { | |
console.log('Opened cache'); | |
return cache.addAll(urlsToCache); |
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
/** | |
* @param {string} name - Parameter name | |
* @param {string} url - URL to extract parameters from (Optional) | |
*/ | |
function getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
results = regex.exec(url); | |
if (!results) return null; |
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 | |
/** | |
* Disable Emojis | |
*/ | |
remove_action('admin_print_styles', 'print_emoji_styles'); | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('admin_print_scripts', 'print_emoji_detection_script'); | |
remove_action('wp_print_styles', 'print_emoji_styles'); | |
remove_filter('wp_mail', 'wp_staticize_emoji_for_email'); | |
remove_filter('the_content_feed', 'wp_staticize_emoji'); |
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
// https://github.com/felix/gtm-scrolldepth | |
var startTime = +new Date; | |
var scrollCache = []; | |
documentElement = document.documentElement; | |
function throttle(func, wait) { | |
var context, args, result; | |
var timeout = null; | |
var previous = 0; | |
var later = function () { |
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
<ifModule mod_headers.c> | |
Header always set X-Content-Type-Options "nosniff" | |
Header always set X-XSS-Protection "1; mode=block" | |
Header always set X-Frame-Options "deny" | |
</IfModule> |
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
function slugify(text) | |
{ | |
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; | |
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz"; | |
text = text.split(''); | |
var txtLen = text.length; | |
var i, x; | |
for (i = 0; i < txtLen; i++) { | |
if ((x = accents.indexOf(text[i])) != -1) { | |
text[i] = accentsOut[x]; |
OlderNewer