Skip to content

Instantly share code, notes, and snippets.

View gshutler's full-sized avatar
📅
👨‍💻

Garry Shutler gshutler

📅
👨‍💻
View GitHub Profile
@gshutler
gshutler / table.markdown
Created August 11, 2012 21:02
Idea for creating a table in markdown

Possible Markdown for tables

I noticed that there isn't a format for creating tables in Markdown.

My idea is to just use the | (pipe) character to delimit columns in a table with the first line of "cells" always assumed to be a row of headings:

 | Number | Rider        | Time  |
 | 1      | Bullet Bob   | 56:07 |
 | 2 | Clumsy Colin | DNF |
@gshutler
gshutler / update-rbenv-rubygems.sh
Created June 9, 2015 14:24
Update Rubygems for all rbenv rubies
#! /usr/bin/env bash
set -e
eval "$(rbenv init -)"
for version in `rbenv whence gem`; do
rbenv shell "$version"
echo "Updating rubygems for $version"
gem update --system --no-document --quiet
@gshutler
gshutler / EntityMap.cs
Created April 2, 2010 21:31
Demonstration of how to back a GUID with a string column with Fluent NHibernate
using FluentNHibernate.Mapping;
using Custom.Domain;
using Custom.Mappings.UserTypes;
namespace Custom.Mappings
{
public abstract class EntityMap<T> : ClassMap<T> where T : Entity
{
protected EntityMap()
{

Keybase proof

I hereby claim:

  • I am gshutler on github.
  • I am gshutler (https://keybase.io/gshutler) on keybase.
  • I have a public key ASCbXYc3dDoaZyxROV8NYXeq2fMIrSN_OogCZJpqe0IOAwo

To claim this, I am signing this object:

#!/usr/bin/env ruby
require "rubygems"
# Take a copy of the arguments as rubygems or bundler modifies them
args = ARGV.dup
begin
gem "bundler"
rescue Gem::LoadError
@gshutler
gshutler / proposal.markdown
Last active December 30, 2015 16:49
I'm sorry Dave, I'm afraid I don't understand that

I'm sorry Dave, I'm afraid I don't understand that

What happens when you think of email as a primary interface?

At One Diary we have spent as much time and effort on email as an interface as our website. I'll explain why we made that choice and how you can create your own.

I'll cover all we've learnt, from the basics of how to do it, how to overcome common pitfalls, tips and tricks for refining the experience, and a short introduction to natural language processing.

@gshutler
gshutler / gh-build-notification.sh
Created August 4, 2013 14:25
Tagging a commit with build status on GitHub
#! /usr/bin/env bash
# Examples
#
# $ gh-build-notification.sh pending "Build in progress"
# $ gh-build-notification.sh failure "Build failed"
# $ gh-build-notification.sh success "Build succeeded"
commit=`git rev-parse HEAD`
@gshutler
gshutler / consumption.rb
Last active December 19, 2015 22:59
Prioritised queue consumption with multiple queues
queues = []
queues << queue_consumer("high")
queues << queue_consumer("normal")
def next_message
# look for a message from each queue in priority order
queues.each do |queue|
found, message = queue.non_blocking_dequeue
return [found, message] if found
end
@gshutler
gshutler / log_listener.rb
Created April 13, 2013 18:02
Script hacked from https://github.com/ajfaraday/Text-to-music for listening to log files. A day of logs can be listened to in under a minute.
#
# Andrew James Faraday - May 2012
#
# This script is to allow direct manual control of the text-to-music algorithm.
# After a simple check of speed (1 divided by numbers 1 to 10 = number of seconds between characters) the user is prompted to provide textual input which is then sonified.
# This is recommended as a first experience of the text-to-music system, so new users can see the correlation between their use of text and the resulting sound.
# press ctrl+c to exit the script
#
#
@gshutler
gshutler / example.rb
Created January 10, 2013 21:27
Example of nested diagnostic contexts with Hatchet
class Example
include Hatchet
def run
log.info { "Hello" }
# => "Example - Hello"
log.ndc.scope(:nest) do
log.info { "Hi" }
# => "Example nest - Hi"