Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing on learning something every day

Matthew Harris rtpHarry

🎯
Focusing on learning something every day
View GitHub Profile
@rtpHarry
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 https://gist.github.com/kenhowardpdx/8484076
// 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="https://www.googletagmanager.com/gtag/js?id='. $analytics_id .'"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
@rtpHarry
rtpHarry / animation.js
Last active Sep 13, 2019
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
// https://github.com/paulmg/ThreeJS-Webpack-ES6-Boilerplate
// 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
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
rtpHarry / Orchard-Documentation-Notes.md
Created Apr 16, 2016
Some notes that I've made so far for contributing to the orchard docs project
View Orchard-Documentation-Notes.md

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
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>() {
You can’t perform that action at this time.