Skip to content

Instantly share code, notes, and snippets.

View JamiesonRoberts's full-sized avatar
👋

Jamieson Roberts JamiesonRoberts

👋
View GitHub Profile
@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 / 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 / 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-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-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.
*/