Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Cooper cooperaj

View GitHub Profile
View openpgp.md
View keybase.md

Keybase proof

I hereby claim:

  • I am cooperaj on github.
  • I am cooperaj (https://keybase.io/cooperaj) on keybase.
  • I have a public key whose fingerprint is 606B 2E3C 103A 4436 63DA 8271 6B37 390F 365A ADAA

To claim this, I am signing this object:

@cooperaj
cooperaj / Dockerfile
Created Aug 13, 2018
Hugo docker build
View Dockerfile
# Build stage
FROM node:8 as build
ENV HUGO_VERSION 0.45
# Install dependencies
RUN apt-get update && apt-get install -y \
nasm && \
curl -sLo hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz" && \
mkdir hugo && \
@cooperaj
cooperaj / phpunit_to_junit.xsl
Created Apr 12, 2017
XSLT transform to fix PHPunit junit output.
View phpunit_to_junit.xsl
<?xml version="1.0" encoding="UTF-8"?>
<!--
PHPUnit does not output valid junit files. This XSLT file transforms the
output it does have to be valid.
Found here on a jetbrains Teamcity issue (they added an exception to their
junit parser since PHPUnit shows no inclination to change):
https://youtrack.jetbrains.com/issue/TW-17249#comment=27-231993
View Vagrantfile
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
homesteadYamlPath = File.dirname(__FILE__) + "/Homestead.yaml"
afterScriptPath = "after.sh"
aliasesPath = "aliases"
@cooperaj
cooperaj / ResilientCache.php
Last active Aug 29, 2015
Resilient Doctrine Cache Wrapper
View ResilientCache.php
<?php
namespace Bolt\Extension\Cooperaj\BoltTwitter;
use Doctrine\Common\Cache\Cache;
class ResilientCache implements Cache
{
/**
* @var Cache
View keybase.md

Keybase proof

I hereby claim:

  • I am cooperaj on github.
  • I am cooperaj (https://keybase.io/cooperaj) on keybase.
  • I have a public key whose fingerprint is F923 DD08 F1FB 440E AC76 D1F4 FA80 8BED 1808 788F

To claim this, I am signing this object:

View gist:10965258
/*****************************************************************
LSM9DS0_AHRS.ino
SFE_LSM9DS0 Library AHRS Data Fusion Example Code
Jim Lindblom @ SparkFun Electronics
Original Creation Date: February 18, 2014
https://github.com/sparkfun/LSM9DS0_Breakout
Modified by Kris Winer, April 4, 2014
The LSM9DS0 is a versatile 9DOF sensor. It has a built-in
@cooperaj
cooperaj / gist:10965142
Created Apr 17, 2014
Processing Teapot
View gist:10965142
// I2C device class (I2Cdev) demonstration Processing sketch for MPU6050 DMP output
// 6/20/2012 by Jeff Rowberg <jeff@rowberg.net>
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// 2012-06-20 - initial release
/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg
@cooperaj
cooperaj / view-wow-armory-character.php
Created Oct 11, 2012
Gnarly view code. Any Ideas
View view-wow-armory-character.php
<?php if ($options['show_feed']) : ?>
<div class="armory_section armory_feed">
<h4><?php _e('Recent Activity', 'wow_armory_character'); ?></h4>
<ul class="armory_feed_list">
<?php $feed_icons = ($options['show_feed'] & WoW_Armory_Character_Plugin::STYLE_FEED_ICONS) === WoW_Armory_Character_Plugin::STYLE_FEED_ICONS;
$feed_achiev = ($options['show_feed'] & WoW_Armory_Character_Plugin::STYLE_FEED_ACHIEVEMENTS) === WoW_Armory_Character_Plugin::STYLE_FEED_ACHIEVEMENTS;
$feed_criteria = ($options['show_feed'] & WoW_Armory_Character_Plugin::STYLE_FEED_CRITERIA) === WoW_Armory_Character_Plugin::STYLE_FEED_CRITERIA;
$feed_loot = ($options['show_feed'] & WoW_Armory_Character_Plugin::STYLE_FEED_ITEMS) === WoW_Armory_Character_Plugin::STYLE_FEED_ITEMS;
$feed_items = $character->get_activity_feed_items(5); // return a max of 5 of each type.