Skip to content

Instantly share code, notes, and snippets.

View dsingley's full-sized avatar

David Singley dsingley

View GitHub Profile
@wbrady
wbrady / create-confluence-spaces.rb
Created March 29, 2013 18:54
Ruby script to create Confluence personal spaces for users who don't have one
#!/usr/bin/env ruby
require 'xmlrpc/client'
puts "Please enter your Confluence base URL:"
base = STDIN.gets.chomp
puts "Please enter your username:"
user_name = STDIN.gets.chomp
@dsingley
dsingley / damm_algorithm.rb
Last active June 7, 2025 11:57
Ruby class implementing H. Michael Damm's check digit algorithm
class DammAlgorithm
# http://en.wikipedia.org/wiki/Damm_algorithm
TABLE = [ [0, 7, 4, 1, 6, 3, 5, 8, 9, 2],
[3, 0, 2, 7, 1, 6, 8, 9, 4, 5],
[1, 9, 0, 5, 2, 7, 6, 4, 3, 8],
[7, 2, 6, 0, 3, 4, 9, 5, 8, 1],
[5, 1, 8, 9, 0, 2, 7, 3, 6, 4],
[9, 5, 7, 8, 4, 0, 2, 6, 1, 3],
[8, 4, 1, 3, 5, 9, 0, 2, 7, 6],