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: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 / 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:1b0d52e1c5edc14f4dcc
Last active August 29, 2015 14:10
Feedly Custom Share to Unmark
Hosted Unmark
https://unmark.it/mark/add?url=${url}&title=${title}
Self-hosted Unmark
http://YOUR-URL-HERE/mark/add?url=${url}&title=${title}
@cdevroe
cdevroe / settings.json
Created December 14, 2014 02:54
settings.json file for The Watercolor Gallery
{
"name": "Cypress - Forked for The Watercolor Gallery",
"creator": "Kyle Ruane and Colin Devroe",
"creator_url": "http://h2ocolor.com",
"blog": "gallery",
"content_types": {
"artspaces": "Art Space",
"interviews": "Artist Interview",
"videos": "Video",
"submit": "Submission Form"
@cdevroe
cdevroe / settings.json
Created December 14, 2014 02:56
settings.json file for GetBarley.com
{
"name": "Streetshark",
"creator": "Plain",
"creator_url": "http://plainmade.com",
"blog": "news",
"content_types": {
"articles": "Article",
"releases": "Release Month"
},
"feed": [
<?php
/*
Tweet Maps
by Colin Devroe
Created on December 26th, 2009
while playing New Super Mario Bros. Wii.
Tweet Maps objective is to take any username's
tweets and place them onto a Google Map.
function generate_osid($length)
{
if($length>0)
{
$rand_id="";
for($i=1; $i<=$length; $i++)
{
mt_srand((double)microtime() * 1000000);
$num = mt_rand(1,36);
$rand_id .= $this->assign_rand_value($num);
@cdevroe
cdevroe / jQuery Confirm delete?
Created March 12, 2010 22:20
jQuery confirm delete?
$(document).ready(function(){
// All links with class delete
$('.delete').click(function(event){
var answer = confirm("Are you sure you want to delete this item?");
if (answer) {
// Delete item.
} else {
event.preventDefault(); // Do not delete item.
}
});
<style type="text/css">
#vidget_list_1753504554 { margin: 0; width: 200px; }
#vidget_list_1753504554 h3 { margin: 0 0 5px 0; padding-left: 40px;}
#vidget_1753504554 { list-style-type: none;}
#vidget_list_1753504554 li { clear: both; margin-bottom: 5px; overflow: auto; padding: 4px; }
#vidget_list_1753504554 li img { float: left; width: 30px; margin-right: 10px; border: 0; padding: 0;}
#vidget_1753504554 li.even { background-color: #eee; }
#vidget_1753504554 p {text-align:center;}
#loading_viddler_1753504554 { text-align: center; }
#loading_viddler_1753504554 img { background-color: #fff; }
<!--[if IE]><object width="437" height="288" id="viddlerOuter-754d9c44" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="movie" value="http://www.viddler.com/player/754d9c44/"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashVars" value="f=1&autoplay=f&disablebranding=f"><object id="viddlerInner-754d9c44"><video id="viddlerVideo-754d9c44" src="http://www.viddler.com/file/754d9c44/html5mobile/" type="video/mp4" width="437" height="246" poster="http://www.viddler.com/thumbnail/754d9c44/" controls="controls"></video></object></object><![endif]--> <!--[if !IE]> <!--> <object width="437" height="288" id="viddlerOuter-754d9c44" type="application/x-shockwave-flash" data="http://www.viddler.com/player/754d9c44/"> <param name="movie" value="http://www.viddler.com/player/754d9c44/"> <param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" val