Skip to content

Instantly share code, notes, and snippets.

View webtrainingwheels's full-sized avatar

Lucy Beer webtrainingwheels

View GitHub Profile
@webtrainingwheels
webtrainingwheels / trustindex-google-widget.css
Created September 6, 2024 20:28
Trustindex Google Reviews CSS file
@font-face{font-family:"Trustindex Open Sans";font-style:normal;font-weight:400;font-display:swap;src:local("Open Sans Regular"), local("OpenSans-Regular"), url("https://cdn.trustindex.io/assets/fonts/opensans/cyrillic-ext.woff2") format("woff2");unicode-range:U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F}@font-face{font-family:"Trustindex Open Sans";font-style:normal;font-weight:400;font-display:swap;src:local("Open Sans Regular"), local("OpenSans-Regular"), url("https://cdn.trustindex.io/assets/fonts/opensans/cyrillic.woff2") format("woff2");unicode-range:U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}@font-face{font-family:"Trustindex Open Sans";font-style:normal;font-weight:400;font-display:swap;src:local("Open Sans Regular"), local("OpenSans-Regular"), url("https://cdn.trustindex.io/assets/fonts/opensans/greek-ext.woff2") format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:"Trustindex Open Sans";font-style:normal;font-weight:400;font-display:swap;src:local("Open Sans
@webtrainingwheels
webtrainingwheels / .htaccess
Created October 30, 2019 23:39
WP Rocket htaccess rules
# BEGIN WP Rocket v3.4.0.5
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
# Force UTF-8 for a number of file formats
<IfModule mod_mime.c>
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
</IfModule>
# FileETag None is not enough for every server.
<IfModule mod_headers.c>
Header unset ETag
<?php
//Disables HTML minification on product category archive pages
add_filter( 'pre_get_rocket_option_minify_html', function() {
if (is_product_category()){
return 0;
}
return null;
This file has been truncated, but you can view the full file.
/**
* @license
* Video.js 7.4.1 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
This file has been truncated, but you can view the full file.
/**
* @license
* Video.js 7.4.1 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
@webtrainingwheels
webtrainingwheels / clear-preload-page.php
Created July 16, 2019 16:20
Clear and preload a specific page
<?php
// Load WordPress.
require( 'wp-load.php' );
// Clear specific page cache
if ( function_exists( 'rocket_clean_post' ) ) {
rocket_clean_post('30');
}
// Preload page
register_sidebar( array(
'name' => 'Footer Widget',
'id' => 'footer-widget',
'before_widget' => '<div class="footer-widget">',
'after_widget' => '</div>'
) );
add_action( 'twentysixteen_credits', 'wtw_custom_footer_widget' );
@webtrainingwheels
webtrainingwheels / WCSD 2016 - CSS
Last active April 20, 2016 07:07
WCSD 2016 - CSS
.site-title {
font-size: 3.75rem;
}
.site-branding .site-title a {
color: #FF0000;
}
.site-branding {
margin-top: 0px;
@webtrainingwheels
webtrainingwheels / gist:f7d3541c1b79d0a1716e
Last active September 7, 2015 16:12
function to calculate age
<?php
function how_old_am_i($todaydate, $mybday) {
//convert given dates to timestamps
$currenttimestamp = strtotime($todaydate);
$bdaytimestamp = strtotime($mybday);
//get just the years from the timestamps
$currentyear = date("Y",$currenttimestamp);
$mybd = date ("Y",$bdaytimestamp);