Skip to content

Instantly share code, notes, and snippets.

View fearoffish's full-sized avatar

Jamie van Dyke fearoffish

View GitHub Profile
@fearoffish
fearoffish / create_labels.sh
Last active November 7, 2017 14:32 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/local/bin/bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
# Updates for making it work on OS X with a homebrew bash and ignoring null errors
###
# Label definitions
###
declare -A LABELS
def step?(step)
@current_step.nil? || current_step + 1 == step
end
» @object.current_step
=> 0
» @object.step?(0)
=> true
» @object.step?(1)
=> true
@fearoffish
fearoffish / Calculator
Last active December 16, 2015 20:29 — forked from anonymous/Calculator
Module Module1
Sub Main()
Dim intNumber1, intNumber2 as Integer
Dim strOperator As String
Do
strOperator = InputBox("Please choose an operator to use: +, -, *. Or type Q to quit.")
If strOperator = "Q" Then Exit
intNumber1 = InputBox("Please Enter The Value For The First Number")
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
class CreateMessages < ActiveRecord::Migration
def change
create_table :messages do |t|
t.string :subject
t.string :type
t.string :message
t.timestamps
end
end
end
@fearoffish
fearoffish / ubuntu10.04-ruby192.erb
Created July 20, 2011 17:15 — forked from hedgehog/ubuntu10.04-ruby192.erb
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
bash -c '
if [ ! -f /usr/local/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev curl bison build-essential autoconf libxml2-dev libreadline6-dev
cd /usr/src
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p290.tar.bz2
tar xjf ruby-1.9.2-p290.tar.bz2
cd ruby-1.9.2-p290
./configure
@fearoffish
fearoffish / best_todos.coffee
Created May 23, 2011 14:11 — forked from jasonporritt/best_todos.coffee
Use @vars -- translation of Backbone.js example app
initialize: ->
@model.bind('change', @render)
@model.view = this
render: =>
$(@el).html(@template(@model.toJSON()))
@setContent()
return this