Skip to content

Instantly share code, notes, and snippets.

View dcoxall's full-sized avatar

Darren Coxall dcoxall

View GitHub Profile
@dcoxall
dcoxall / droneci.json
Created January 24, 2016 09:04
Cloudformation template to deploy drone to AWS using EC2 Container Service
{
"Description": "Drone Continuous Integration (drone.io)",
"Parameters": {
"VPC": {
"Type": "AWS::EC2::VPC::Id",
"Description": "The VPC that needs provisioning"
},
"Subnets": {
"Type": "List<AWS::EC2::Subnet::Id>",
### Keybase proof
I hereby claim:
* I am dcoxall on github.
* I am dcoxall (https://keybase.io/dcoxall) on keybase.
* I have a public key whose fingerprint is 3AF3 6BDE 5CE9 0541 5A31 237C 94CB 5532 5478 5774
To claim this, I am signing this object:
#!/bin/bash
# Author: slowpoke <proxypoke at lavabit dot com>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
#
# A pre-commit hook for go projects. In addition to the standard
class Player
def play_turn(warrior)
# cool code goes here
@warrior = warrior
@previous_health ||= @warrior.health
forward_spaces = @warrior.look
backward_spaces = @warrior.look(:backward)
@dcoxall
dcoxall / gist:6073505
Last active December 20, 2015 04:49
A quick script to demonstrate an easy way to execute ruby
#!/usr/bin/env ruby
require 'trollop'
class Command
def initialize(options = {})
@default_name = options[:name]
end
def execute
name = ask "Hello, ...?" unless name = @default_name
@dcoxall
dcoxall / breakpoints.js
Created May 14, 2012 22:24
Use Riloadr and wordpress to create a theme that displays responsive
// The names are used to fit into wordpress's naming convention
var featuredImage = new Riloadr({
breakpoints: [
{name: '-466x155', maxWidth: 466},
{name: '-700x233', maxWidth: 700, minWidth: 467},
{name: '-940x313', maxWidth: 940, minWidth: 701},
{name: '', minWidth: 940}
]
});
@dcoxall
dcoxall / gist:961644
Created May 8, 2011 19:58
My Google Code Jam Letter Stamper Solution
# Extend the Array class to provide a
# contains? method and a method
class Array
def contains?(item)
return false if self.nil?
self.each do |i|
return true if (item == i)
end
return false
end
@dcoxall
dcoxall / Simple Sass Grids
Created May 5, 2011 00:45
Simple Sass Grid Framework
$content_width: 960px
$margin_size: 20px
$columns: (1, 2, 3, 4, 5, 6)
$column_width: ($content_width - (( length($columns) - 1 ) * $margin_size )) / length($columns)
@function grid_width($n: 1)
@if ($n < 1)
@return $column_width
@return ($column_width * $n) + (($n - 1) * $margin_size)