Skip to content

Instantly share code, notes, and snippets.

@joshlevinson
joshlevinson / eight-day-week-filters.php
Created November 6, 2015 15:10
Sample Eight Day Week filters for the Observer
<?php
add_filter( 'Eight_Day_Week\Plugins\Article_Export\xml_outer_elements', function( $elements, $article ) {
$elements['subHeadline'] = get_post_meta( $article->ID, 'nyo_dek', true );
return $elements;
}, 10, 2 );
add_filter( 'Eight_Day_Week\Plugins\Article_Export\xml_outer_elements', function( $elements, $article ) {
if( function_exists( '\Eight_Day_Week\Plugins\Article_Byline\get_article_byline' ) ) {
$elements['byline'] = \Eight_Day_Week\Plugins\Article_Byline\get_article_byline( $article );
@joshlevinson
joshlevinson / index.html
Created January 27, 2016 21:29
Google Plus Comments
<script src="https://apis.google.com/js/plusone.js"></script>
<script>
gapi.comments.render('comments', {
href: window.location,
width: '760',
first_party_property: 'BLOGGER',
view_type: 'FILTERED_POSTMOD'
});
</script>
<html>
@joshlevinson
joshlevinson / git-archive.sh
Created June 7, 2016 18:57
Archive git branches
#!/bin/sh -x
# Exit if any error is encountered:
set -o errexit
# git name-rev is fail
# Get the branch name and replace the string from an array of values for instance "feature/" with "archive/"
CURRENT=`git branch | grep '\*' | awk ' {print $2}'`
ARCHIVE=`git branch | grep '\*' | awk ' {print $2}' | sed 's,.*[a-z]/,,g' | sed 's,^,archive/,g'`
#Check if we are on master or develop since we don't want to tag those
if [ $CURRENT = 'master' ]