Skip to content

Instantly share code, notes, and snippets.

View jnritchie's full-sized avatar

Justin Ritchie jnritchie

  • Caribbean
View GitHub Profile
@jnritchie
jnritchie / WordPress Custom Global Variables.md
Created March 13, 2019 15:37 — forked from aahan/WordPress Custom Global Variables.md
Creating and using custom global variables in wordpress.

First create global variables (in functions.php or as a mu-plugin):

<?php

/*
 * CUSTOM GLOBAL VARIABLES
 */
function wtnerd_global_vars() {
@jnritchie
jnritchie / contact.html
Created March 8, 2019 01:07
Mailgun Contact Form
<div class="contact-form">
<form id="contactform" name="contactform" method="post">
<div class="row">
<div class="col-sm-6">
<input name="name" class="form-control" type="text" placeholder="Name*"/>
</div>
<div class="col-sm-6">
<input name="email" class="form-control" type="email" placeholder="Email*"/>
</div>
<div class="clearfix"></div>
@jnritchie
jnritchie / scrollstyle.js
Created February 28, 2019 21:54
Scroll Style Changes
$(window).scroll(function() {
var y_scroll_pos = window.pageYOffset;
var scroll_pos_test = 150;
// set to whatever you want it to be
if(y_scroll_pos > scroll_pos_test) {
//$("body").css("background-color","#000");
}
else
{
@jnritchie
jnritchie / videoshuffle.js
Last active July 1, 2019 17:35
Video Shuffle
videoshuffle();
function videoshuffle() {
var vids = ["/public/media/v1.mp4","/public/media/v2.mp4"];
var currVid = vids[Math.floor(Math.random()*(vids.length))];
console.log(currVid);
$("#videobg source").attr("src", currVid);
$("#videobg")[0].load();
@jnritchie
jnritchie / Favicon MetaTags
Created January 16, 2019 20:38 — forked from cpswsg/Favicon MetaTags
Meta Tags for Favicon
<!-- Favicon -->
<meta name="msapplication-TileImage" content="images/favicons/tile.png"> <!-- Windows 8 -->
<meta name="msapplication-TileColor" content="#00CCFF"/> <!-- Windows 8 color -->
<!--[if IE]><link rel="shortcut icon" href="images/favicons/favicon.ico"><![endif]-->
<link rel="icon" type="image/png" href="images/favicons/favicon.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/favicons/apple-touch-icon-precomposed-144x144.png"><!-- iPad Retina-->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/favicons/apple-touch-icon-precomposed-114x114.png"><!--iPhone Retina -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/favicons/apple-touch-icon-precomposed-72x72.png"><!-- iPad 1 e 2 -->
<link rel="apple-touch-icon-precomposed" href="images/favicons/apple-touch-icon-precomposed-57x57.png"><!-- iPhone, iPod e Android 2.2+ -->
@jnritchie
jnritchie / woocommerce sort
Created September 7, 2016 17:12
Sort by SKU woocommerce
add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby'); function am_woocommerce_catalog_orderby( $args ) { $args['meta_key'] = '_sku';
$args['orderby'] = 'meta_value'; $args['order'] = 'asc'; return $args; }
@jnritchie
jnritchie / smoothscroller.js
Created August 19, 2016 15:05
Smooth scroll on .scroll class
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);
});
@jnritchie
jnritchie / airtime.liq
Created November 25, 2015 00:44 — forked from dz0ny/airtime.liq
Airtime random playout
jingli = playlist(mode='randomize',reload=1,reload_mode="rounds", "/home/baza/jingli/")
baza = playlist(mode='randomize',reload=1,reload_mode="rounds", "/home/baza/baza/")
baza_imported = playlist(mode='randomize',reload=1,reload_mode="rounds", "/srv/airtime/stor/imported/")
default = random(weights = [5, 1, 2], [jingli,baza, baza_imported])
<div class="col-lg-12 col-md-12 col-sm-12" ng-controller="ContactController">
<div class="alert alert-danger" ng-show="error">
<button class="close" data-dismiss="alert">x</button>
<strong>Error!</strong> An error occured while trying to send message.
</div>
<div class="alert alert-success" ng-show="success">
<button class="close" data-dismiss="alert">x</button>
<strong>Success! </strong> Your message was successfully sent.
</div>
<form role="form" name="contactForm">
<form id="contact" name="contact" method="post">
<fieldset>
<label for="name" id="name">Name<span class="required">*</span></label>
<input type="text" name="name" id="name" size="30" value="" required/>
<label for="email" id="email">Email<span class="required">*</span></label>
<input type="text" name="email" id="email" size="30" value="" required/>
<label for="phone" id="phone">Phone</label>
<input type="text" name="phone" id="phone" size="30" value="" />