Skip to content

Instantly share code, notes, and snippets.

@cooperaj
cooperaj / keybase.md
Created April 5, 2019 13:30
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 August 13, 2018 13:41
Hugo docker build
# 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 April 12, 2017 11:26
XSLT transform to fix PHPunit junit output.
<?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
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 August 29, 2015 14:16
Resilient Doctrine Cache Wrapper
<?php
namespace Bolt\Extension\Cooperaj\BoltTwitter;
use Doctrine\Common\Cache\Cache;
class ResilientCache implements Cache
{
/**
* @var Cache
@cooperaj
cooperaj / keybase.md
Created October 2, 2014 13:41
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:

@cooperaj
cooperaj / gist:10965258
Created April 17, 2014 08:38
Arduino 9dof
/*****************************************************************
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 April 17, 2014 08:37
Processing Teapot
// 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 October 11, 2012 11:04
Gnarly view code. Any Ideas
<?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.