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 / wp-export.html
Created November 19, 2014 15:39
Export Barley CMS to WordPress (WIP)
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
<!-- It contains information about your blog's posts, comments, and categories. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your blog. -->
<!-- To import this information into a WordPress blog follow these steps. -->
<!-- 1. Log into that blog as an administrator. -->
<!-- 2. Go to Manage: Import in the blog's admin panels. -->
<!-- 3. Choose "WordPress" from the list. -->
@cdevroe
cdevroe / classnames
Created July 3, 2014 13:13
Bootstrap Glyphicon List, Class names, CSV
glyphicon glyphicon-asterisk
glyphicon glyphicon-plus
glyphicon glyphicon-euro
glyphicon glyphicon-minus
glyphicon glyphicon-cloud
glyphicon glyphicon-envelope
glyphicon glyphicon-pencil
glyphicon glyphicon-glass
glyphicon glyphicon-music
glyphicon glyphicon-search
@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({});
@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: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

<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>
<!-- 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>
@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>
@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_repeatablesections
Created February 15, 2013 22:05
Barley: Repeatable Sections Example
<!-- repeat:blogpost:5 -->
<your code />
<!-- endrepeat -->
<!-- repeat:my_section:10 -->
<your code />
<!-- endrepeat -->