Skip to content

Instantly share code, notes, and snippets.

View burtlo's full-sized avatar

Lynn Frank burtlo

View GitHub Profile
@burtlo
burtlo / .studiorc
Last active October 18, 2017 16:22
A script to help run packages that are built within the Habitat Studio.
# Usage
#
# run pkg_name # Run the latest
# run pkg_name HEAD # Run the latest
# run pkg_name HEAD~1 # Run the second to last
# run pkg_name ~1 # Run the second to last
#
function run() {
local pkg_name=$1
local pkg_position=$2
@burtlo
burtlo / gist:89dc7d025d1ab484c2468740aadbe87e
Created October 18, 2017 15:56
A script to help run packages that are built within the Habitat Studio.
# run pkg_name HEAD
# run pkg_name HEAD~1
function run() {
local pkg_name=$1
local pkg_position=$2
local found_pkgs=( ./results/$HAB_ORIGIN-$pkg_name-*.hart )
local pkg_count=${#found_pkgs[@]}
declare -A indexed_pkgs
@burtlo
burtlo / city_builder.rb
Created October 19, 2010 00:46
Registering a parser with YARD
module Cucumber
module Parser
class CityBuilder
include Gherkin::Rubify
def initialize(file)
@file = file
end
@burtlo
burtlo / Guardfile
Created March 11, 2012 15:41
HAML with YAML
guard 'shell' do
watch(/(.*).(?:haml|ya?ml)/) do |file|
haml_file = file.first.gsub(/ya?ml/,'haml')
html_file = file.first.gsub(/[yh]a?ml/,'html')
puts "Converting #{haml_file} to #{html_file}"
`haml #{haml_file} > #{html_file} --trace`
end
end
@burtlo
burtlo / census.json
Last active September 12, 2017 16:11
Web Application with a Load Balancer
{
"changed": true,
"census_groups": {
"haproxy.default": {
"service_group": "haproxy.default",
"election_status": "None",
"update_election_status": "None",
"leader_id": null,
"service_config": null,
"local_member_id": "67e892170b80482d98bb259389ce951d",
@burtlo
burtlo / sample_entry.markdown
Created October 16, 2013 21:13
Developers are using Octopress to deliver information to other developers. It is important that we consider those other developers when creating our content and how that content is displayed. Defining a custom liquid tag helps you represent your content in a way that is easy to understand. The following gist contains all the content you need to …

To get started with Rails we need to install the gem. From the terminal type:

{% terminal %}
$ gem install rails
Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.3.6.gem (100%)
Fetching: activesupport-3.2.8.gem (100%)
...
{% endterminal %}
[ec2-user@ip-10-0-0-10 delivery-cluster-master]$ rake setup:cluster
-bash: rake: command not found
[ec2-user@ip-10-0-0-10 delivery-cluster-master]$ chef exec rake setup:cluster
Verifying ChefDK version
Running ChefDK version 0.10.0
Configuring the provisioner node
@burtlo
burtlo / Rakefile
Last active June 13, 2016 20:49
Using ERB
namespace :gsub do
desc 'populate a configuration'
task :populate do
content = File.read('config.yml')
content.gsub!('REPLACE_ME_KEY','REAL_KEY')
content.gsub!('REPLACE_ME_ID','REAL_ID')
puts content
end
@burtlo
burtlo / CursorScript.cs
Last active December 30, 2015 13:39
Exploring some C# in Unity. Reading through and implementing one of the recipes found in Unity 4.x Cookbook, http://www.packtpub.com/unity-4-x-cookbook/book.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class CursorScript : MonoBehaviour {
public Texture2D iconArrow;
public Vector2 arrowRegPoint;
public Texture2D iconZoom;
@burtlo
burtlo / !result.md
Last active December 29, 2015 06:39

The Problem

I wanted to use a background gradient to represent the types of a Pokémon. There are 18 possible Pokémon types. Pokémon can have one type and some have two types. This leads to roughly 324 combinations (When a Pokémon is one type I simply double that type) or 171 combinations (18 as a triangular number) if I order the types.

The Result

Static Image: Pokemon Types Live: http://attackdex.herokuapp.com/

The Method