Skip to content

Instantly share code, notes, and snippets.

Jay Holtslander JayHoltslander

Block or report user

Report or block JayHoltslander

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Bulk WebP convert.sh
find ./ -type f -name '*.jpg' -exec sh -c 'cwebp -q 75 $1 -o "${1%.png}.webp"' _ {} \;
@JayHoltslander
JayHoltslander / private-wp-admin
Created Nov 14, 2018
Redirect unauthorized IP addresses that try to access Wordpress' wp-admin
View private-wp-admin
#REDIRECT UNAUTHORIZED IP ADDRESSES THAT TRY TO ACCESS WP-ADMIN
#
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# IF YOU WANT INTO THE WORDPRESS ADMIN AREA...
RewriteCond %{REQUEST_URI} ^/wp-admin.*
# AND YOU'RE NOT ON ONE OF THESE IP ADDRESSES...
@JayHoltslander
JayHoltslander / deactivate-plugins-on-domain.php
Last active Oct 23, 2018 — forked from subharanjanm/deactivate-plugins-wpe-staging.php
Deactivate certain Wordpress plugins when running on the development/staging domain
View deactivate-plugins-on-domain.php
<?php
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$plugins = array(
'wordpress-seo/wp-seo.php',
'broken-link-checker/broken-link-checker.php'
);
if ( strpos(get_site_url(), 'devserver.com') !== false ) {
deactivate_plugins( $plugins );
}
else {
View gist:c1c4e7f72e803a30a5466a69c5fe4927
Alberta
British Columbia
Manitoba
New Brunswick
Newfoundland and Labrador
Northwest Territories
Nova Scotia
Nunavut
Ontario
Prince Edward Island
View List - Canadian Cities.txt
Abbotsford
Airdrie
Armstrong
Barrie
Bathurst
Belleville
Brampton
Brandon
Brant
Brantford
View non-critical.css
.non-critical {
background-color: yellow; text-align:center; padding:30px; height:20%;
}
.non-critical a {color:black;}
@JayHoltslander
JayHoltslander / picture-element.css
Created Sep 27, 2017
<picture> Element for responsive images.
View picture-element.css
<!--
SOURCE REFERENCES
See:
* https://www.html5rocks.com/en/tutorials/responsive/picture-element/
* https://cloudfour.com/thinks/dont-use-picture-most-of-the-time/
-->
<style>
.responsive-image {
height: 100%;
@JayHoltslander
JayHoltslander / example.html
Last active Jun 29, 2017
Marvel App Optimized YouTube Embed. Use in conjunction with the instructions at https://help.marvelapp.com/hc/en-us/articles/208395615-How-do-I-embed-video-
View example.html
<!-- "playlist" must be the same individual video id in order for continuous looping to work -->
<iframe src="https://www.youtube.com/embed/Zdjg9yhBqTU?modestbranding=1&playlist=Zdjg9yhBqTU&controls=0&showinfo=0&rel=0&iv_load_policy=3&autoplay=1&loop=1&keyboard=1" allowfullscreen="0" frameborder="0"></iframe>
@JayHoltslander
JayHoltslander / 0_reuse_code.js
Created Nov 29, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View javascript.js
// SHOW/HIDE SOCIAL MONARCH PLUGIN DEPENDING ON SCROLL POSITION
if( $(window).width() >= 1025) { // if above default responsive breakpoint
$(document).ready(function() {
$(".et_social_sidebar_networks").hide(); // hide initially
var topOfOthDiv = $(".content").offset().top - 390; // set div position
$(window).scroll(function() {
if($(window).scrollTop() > topOfOthDiv) { // scrolled below div?
$(".et_social_sidebar_networks").show(); // show
}
You can’t perform that action at this time.