Skip to content

Instantly share code, notes, and snippets.

View JamiesonRoberts's full-sized avatar
👋

Jamieson Roberts JamiesonRoberts

👋
View GitHub Profile
@JamiesonRoberts
JamiesonRoberts / code-example-1
Created December 23, 2014 19:34
Code Example 1 - Custom RSS feed
<?php
/**
* RSS 0.92 Feed Template for displaying RSS 0.92 Posts feed.
*
* @package WordPress
Custom RSS feed generation using sorting based off of a custom post meta value so that only certain posts are selected.
*/
@JamiesonRoberts
JamiesonRoberts / code-example-2
Created December 23, 2014 19:48
Custom Wordpress Function for RSS output and file size calculation
<?php
/*
*
* Custom function to add a field to the top of all RSS feeds. Captures the most recent post from a custom post type, finds the attached
* PDF file (news archive) and the calculates the size and outputs the variables into the RSS XML.
*
*
*/
add_action('rss2_head','current_archive');
@JamiesonRoberts
JamiesonRoberts / code-example-3
Created December 23, 2014 20:19
XML export file for migrating content between Cascade and Wordpress
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<!-- URL prefix for news item links -->
<xsl:variable name="website_prefix">http://communications.uwo.ca</xsl:variable>
<xsl:variable name="currentDateTime" select="//system-index-block/@current-time"/>
<!-- File extension used -->
<xsl:variable name="file_extension">.html</xsl:variable>
<!-- RSS extension to use -->
@JamiesonRoberts
JamiesonRoberts / code-example-4
Created December 23, 2014 20:39
Code Example to access the github API and output the repositories in alphabetical order
<!doctype html>
<!--[if lt IE 9]><html class="ie"><![endif]-->
<!--[if gte IE 9]><!--><html><!--<![endif]-->
<!--
The comment jumble above is handy for targeting old IE with CSS.
http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
-->
<head>
@JamiesonRoberts
JamiesonRoberts / SassMeister-input.scss
Created June 23, 2015 21:06
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$value1: null;
$color1: red;
@function fallback($value, $default) {
@if $value != null {
@return $value;
@JamiesonRoberts
JamiesonRoberts / SassMeister-input.scss
Created July 13, 2015 13:36
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$browser-context: 16; // Default
@function em($pixels, $context: $browser-context) {
@return #{$pixels/$context}em;
}
@JamiesonRoberts
JamiesonRoberts / youtube.js
Last active August 29, 2015 14:26
Simple script to get the videos that are part of a playlist on youtube
var playlistID = 'PLmKbqjSZR8TaNjzkuwaFOqjQibUnS2w6u';
var youtubeKEY = '{YOUR-API-KEY-HERE}';
var playlistJSON;
// This needs to be revised/updated to remove the error for a depreciation
function playListGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
@JamiesonRoberts
JamiesonRoberts / header-overrides.php
Last active April 22, 2019 09:56
Wordpress 4.7.x Head Cleanup Script
<?php
/**
* Created by jamiesonroberts
* Date: 2017-04-08
*/
/**
* Removes security vulnerabilities, extraneous styles and scripts,
* as well as related resource inclusions for Wordpress 4.7.x
*
@JamiesonRoberts
JamiesonRoberts / .htaccess
Last active October 17, 2018 19:07
Serverpilot Apache customizations
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
a,
abbr,
acronym,
address,
applet,
article,
aside,
audio,
b,
big,