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 / microblog-userstyle.css
Created May 21, 2018 17:29
Micro.blog Userstyle
/* Add bottom border and some spacing to each post. */
.post {
border-bottom: 1px solid rgb(230, 236, 240);
margin-bottom: 20px;
}
/* Move avatar to left */
.post .post_avatar {
float: left;
width: 18%;
}
@cdevroe
cdevroe / gist:4fb3ebf7806b39020c33
Created May 28, 2015 14:17
Open Visual Studio Code from Terminal
code () {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code" -n
else
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
open -a "Visual Studio Code" -n --args "$F"
fi
}
@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 / nepa-gulp.js
Created July 14, 2017 15:10
NEPA.js Gulp Demo
/*
Task: NepaJS
Does some silly things for NEPA JS
*/
gulp.task('nepajs', function() {
var nepajsURL = 'https://www.meetup.com/NEPA-js/',
nepaJSDirWin = '/mnt/c/Users/tucker/Desktop/',
nepaJSDirMac = '/Users/cdevroe/Desktop/',
@cdevroe
cdevroe / tweet-status.php
Created January 25, 2017 19:35
Publish posts, statuses, images, to Twitter from WordPress
<?php
/**
* Plugin Name: Tweet Statuses
* Description: A simple plugin that will tweet a status when published.
* Author: Colin Devroe
* Author URI: http://cdevroe.com/
* Version: 0.1.0
*
* TwitterAPIExchange is here: http://github.com/j7mbo/twitter-api-php
*/
@cdevroe
cdevroe / convert_roman.js
Created January 9, 2017 13:52
INCOMPLETE: Convert number into Roman numeral in JavaScript
(function (win,doc) {
'use strict';
var submit = document.getElementById('submit');
submit.addEventListener( 'click', function(){
var number = document.getElementById('number'),
roman_numeral = document.getElementById('roman');
roman_numeral.innerHTML = convert_to_roman(number.value);
@cdevroe
cdevroe / wp-is_published-is_draft.php
Created January 6, 2016 16:03
WordPress is_published is_draft functions
<?php
/**
* Determine whether a post or page is published or not.
*
* @return bool
*/
function is_published(){
$post = get_post();
if ( $post->post_status == 'publish' ) return true;
@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>