Skip to content

Instantly share code, notes, and snippets.

View warmwaffles's full-sized avatar
🛠️
Code Wrestling

Matthew Johnston warmwaffles

🛠️
Code Wrestling
View GitHub Profile
# A wrapper library for the `OpenSSL::Cipher::Aes` library. It's fairly simple
# and allows for an easier way to call.
#
# @see http://www.ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Cipher.html OpenSSL::Cipher::AES
#
# @author Matthew A. Johnston
class Aes
# The only valid key sizes
KEY_SIZES = %w{128 192 256}
#!/bin/bash
function show_usage() {
echo "Usage: prep <gemset> [ruby=2.0.0] [directory=gemset]"
echo " - <gemset> the directory it is in. If it is not in that directory"
echo " please specify one."
echo " - [ruby] the version of ruby you want to use. Default is 2.0.0"
echo " - [directory] the directory the gemset. Default is the gemset"
}
import java.io.PrintStream;
/**
* @formatter:off
* @author Matthew A. Johnston [warmwaffles@gmail.com]
*/
public class Logger {
public static final int NONE = 0;
public static final int ERROR = 1;
public static final int WARN = 2;
class ReportJSONPresenter
attr_reader :report
def initialize(report)
@report = report
end
def to_h
{
name: report.name,
class Range
# Allows you to do the following
#
# a = (0..3)
# b = (2..4)
# a.intersection(b) #=> (2..3)
#
def intersection(other)
if self.max < other.begin || other.max < self.begin
return (1..0)
#!/bin/bash
# To be invoked like so
# ghc 2days
origin=`git remote -v | head -1 | cut -d":" -f2 | cut -d"." -f1`
branch=`gcb`
open "https://github.com/${origin}/compare/${branch}@{$1}...${branch}"
for f in $(find . -name \*.rar) ; do
dir=./unrared/${f%/*}
mkdir -p $dir
unrar x -o- "$f" $dir
done
module Analytic
class Query < OpenStruct
SPECIAL = {
'start-index' => 'start_index',
'max-results' => 'max_results',
'start_index' => 'start-index',
'max_results' => 'max-results'
}
#!/bin/bash
echo "pulling nightly down..."
mkdir -p libs
rm libs/*.jar
curl -o libs/gdx.jar "http://libgdx.badlogicgames.com/nightlies/dist/gdx.jar"
curl -o libs/gdx-sources.jar "http://libgdx.badlogicgames.com/nightlies/dist/sources/gdx-sources.jar"
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 2c82712cbc4cde7484784a82a0a7d13ee7728bde
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9-x86_64
Xcode: 5.0.1
CLT: 5.0.1.0.1.1382131676
GCC-4.2: build 5666