Skip to content

Instantly share code, notes, and snippets.

View cdevroe's full-sized avatar
:octocat:
Probably writing.

Colin Devroe cdevroe

:octocat:
Probably writing.
View GitHub Profile
@cdevroe
cdevroe / gist:2423630
Created April 19, 2012 19:42
ViddlerResumableVideo
<html>
<head>
<title>Viddler: Resumable video player demonstration</title>
</head>
<body>
<h1>Viddler: Resumable video player demonstration</h1>
<p>This demonstration goes along with <a href="http://blog.viddler.com/cdevroe/resumable-video/">this Viddler blog post</a>.</p>
<p>Here is a short video from a recent trip to Ireland. If you come back you should start watching the video right where you've left off.</p>
@cdevroe
cdevroe / gist:3749861
Created September 19, 2012 14:04
Forked "Recent Photos" widget Wordpress plugin
<?php
/*
Plugin Name: Recent Posts Photos
Plugin URI: http://www.ProgrammersCountry.com
Description: Displays Recent Posts Photos from the media library in the sidebar. If the post does not contain a photo it is not displayed.
Version: 0.0.2
Author: Asad Iqbal
Author URI: http://www.ProgrammersCountry.com
With edits by Colin Devroe | http://cdevroe.com/
@cdevroe
cdevroe / barley_repeatablesections
Created February 15, 2013 22:05
Barley: Repeatable Sections Example
<!-- repeat:blogpost:5 -->
<your code />
<!-- endrepeat -->
<!-- repeat:my_section:10 -->
<your code />
<!-- endrepeat -->
@cdevroe
cdevroe / Barley_blogindex
Created February 15, 2013 22:07
Barley_exampleblogindex
<!-- repeat:blogpost:5 -->
<article>
<h2 class="title">
<a href="%URL%">%TITLE%</a>
</h2>
<div class="meta">
<h4 class="author">
Written by <span class="emphasize">%AUTHOR%</span> <span class="date">Published on <a href="%URL%" class="published_on" data-barley-publish-post="%ID%">%PUBLISHED_ON%</a></span>
</h4>
</div>
@cdevroe
cdevroe / Barley_H1exmple
Created February 15, 2013 22:08
Barley_H1example
<h1 data-barley="main_title" data-barley-editor="mini">This is my title</h1>
<!-- An image that can not be removed, but can be replaced
Useful for things like logos and placeholder images -->
<span data-barley="your_id_here" data-barley-editor="image"><img src="/images/yourimage.jpg"></span>
<!-- Make an image removable -->
<span data-barley="your_id_here" data-barley-editor="advanced"><img src="/images/yourimage.jpg"></span>
<article>
<h4 data-barley="blogpost_title" data-barley-editor="mini"></h4>
<div data-barley="blogpost_body" data-barley-editor="advanced"></div>
<p><span class="published_on" id="blogpost_published_on" data-barley="blogpost_published_on"></span> | By: <span data-barley="blogpost_author" data-barley-editor="mini"></span></p>
</article>
@cdevroe
cdevroe / gist:6113181
Created July 30, 2013 14:04
Barley Template Options

Sequoia

A responsive business template for Barley.

Features

  • Add Your Own Pages
  • Blog
  • About Page
  • Contact Form

Red Oak

@cdevroe
cdevroe / gist:11399775
Created April 29, 2014 13:07
Shortcodes Ultimate list of Shortcodes
[su_heading size="20" margin="50"]This Is A Heading[/su_heading]
[su_tabs][su_tab title="Tab One"][su_custom_gallery source="media: 1274,1202,917"][/su_tab] [su_tab title="Title 2"][su_quote cite="Colin Devroe" url="http://cdevroe.com"]I love kayaking.[/su_quote][/su_tab] [su_tab title="Title 3"][su_dummy_image][/su_tab][/su_tabs]
[su_accordion][su_spoiler]Content[/su_spoiler] [su_spoiler]Content[/su_spoiler] [su_spoiler]Content[/su_spoiler][/su_accordion]
[su_divider]
[su_spacer]
@cdevroe
cdevroe / gist:e99a2c8faa175b9c327e
Created May 19, 2014 14:47
Only show Google Ads on Posts older than 14 days from published date on Barley CMS
if ( $('[id$=_published_on]').length > 0 ) {
var publishedOn = new Date( $('[id$=_published_on]').html() );
var secondsSincePublished = Math.floor( (new Date() - publishedOn) / 1000 );
var daysSincePublished = Math.floor( secondsSincePublished / 86400 );
if ( daysSincePublished > 14 ) {
console.log('It has been '+daysSincePublished+' days since this post was published so we are going to show a Google Ad.');
(adsbygoogle = window.adsbygoogle || []).push({});