Skip to content

Instantly share code, notes, and snippets.

Focusing on learning something every day

Matthew Harris rtpHarry

Focusing on learning something every day
View GitHub Profile
rtpHarry / soka-elementor-image-carousel-galleryid.php
Last active Jun 14, 2021
Inject a randomised prefix into Elementor Image Carousels so that it separates out the lightboxes contained in JetEngine listings
View soka-elementor-image-carousel-galleryid.php
rtpHarry / functions.php
Created May 21, 2021
Convert a start and end timestamp into a nicely formatted and joined up date range
View functions.php
* Filter for Unlimited Elements to format a date range, from two timestamps
function filter_format_date_range($startTimeStamp, $endTimeStamp){
$displayDate = "";
if($startTimeStamp == $endTimeStamp) {
// same date
$displayDate = date('j M Y', $endTimeStamp);
rtpHarry / WordPress Google Analytics
Last active Mar 16, 2019 — forked from kenhowardpdx/WordPress Google Analytics
Add Google Analytics to WordPress Theme functions.php
View WordPress Google Analytics
// originally based on
// updated to current gtag.js snippet and moved to head
function rtp_init_analytics() {
$analytics_id = 'YOUR UA CODE HERE';
$analytics = '<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="'. $analytics_id .'"></script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
rtpHarry / animation.js
Last active May 11, 2022
Three.js - play an AnimationAction in reverse. There are a bunch of threads saying this isn't possible but I found a way so I wanted to post it online in a place that people will hopefully stumble upon it.
View animation.js
// The class itself is based on the animation helper class in
// but I have changed almost everything except for the class name and the update function.
import * as THREE from 'three';
export default class Animation {
constructor(scene, animations) {
this.scene = scene;
this.animations = animations;
rtpHarry / animation.js
Created Oct 6, 2018
Three.js play an AnimationAction in reverse
View animation.js
import * as THREE from 'three';
export default class Animation {
constructor(scene, animations) {
this.scene = scene;
this.animations = animations;
this.mixer = new THREE.AnimationMixer(this.scene);
rtpHarry /
Created Apr 16, 2016
Some notes that I've made so far for contributing to the orchard docs project

Documentation Glossary

  • Admin Dashboard Anything within the admin panel is referred to as the admin dashboard

  • Orchard Just refer to it as Orchard not Orchard CMS or Orchard Project.

  • Guide A page of docs. Not a topic, tutorial, lesson, etc.

rtpHarry / GetAlphaRouletteLinksHtmlMarkup.cs
Last active Dec 21, 2015
Code sample written for a StackOverflow question to show how to build alpha link roulette html by extracting and grouping the first letters of a list of jobs.
View GetAlphaRouletteLinksHtmlMarkup.cs
public class GetAlphaRouletteLinks
// Outputs markup like this:
// <a href="#rouletteA">A</a> | <a href="#rouletteB">B</a> | <a href="#rouletteC">C</a> | <a href="#rouletteD">D</a> | <a href="#rouletteE">E</a> | <a href="#rouletteF">F</a> | G | <a href="#rouletteH">H</a> | <a href="#rouletteI">I</a> | <a href="#rouletteJ">J</a> | K | <a href="#rouletteL">L</a> | <a href="#rouletteM">M</a> | <a href="#rouletteN">N</a> | <a href="#rouletteO">O</a> | <a href="#rouletteP">P</a> | <a href="#rouletteQ">Q</a> | <a href="#rouletteR">R</a> | <a href="#rouletteS">S</a> | <a href="#rouletteT">T</a> | <a href="#rouletteU">U</a> | V | <a href="#rouletteW">W</a> | X | Y | Z
// Notice how it skips the link for any letters that don't have jobs starting with that letter eg:
// <a href="#rouletteW">W</a> | X | Y | Z
public string GetAlphaRouletteLinksHtmlMarkup()
var JobList = new List<String>() {