Skip to content

Instantly share code, notes, and snippets.

Dan Kubb dkubb

  • Mission, BC, Canada
View GitHub Profile
@dkubb
dkubb / money.rb
Last active Jan 13, 2017
A modern ruby Money class
View money.rb
require 'bigdecimal'
require 'bigdecimal/util'
require 'rubygems'
require 'adamantium'
require 'concord'
class Money
include Adamantium, Concord.new(:amount), Comparable
View enumerable_extensions.rb
module EnumerableExtensions
# An exception raised when an invalid number of entries is returned
class InvalidCountError < StandardError
# Initialize an exception to report an invalid enumerable count
#
# @param expectation [String]
# @param entries [Array]
#
View rubyfmt
#!/usr/bin/env ruby
require 'filemagic'
require 'pathname'
require 'parser/current'
require 'unparser'
RUBY_TYPE = 'ruby script'.freeze
# TODO: handle stdin
@dkubb
dkubb / .gitignore
Last active Aug 29, 2015
Create Statically Linked Haskell Binaries
View .gitignore
*.hi
*.o
*.sw[op]
/.shake
/.stack-work
/dist
/output
@dkubb
dkubb / gist:e2763e1bd1047ab0bcd6
Last active Aug 29, 2015
Slack Conversation about Ruby5 comments
View gist:e2763e1bd1047ab0bcd6
dkubb [12:34 PM]
I feel solnic’s pain in trying to swim against the current
dkubb [12:44 PM]
https://twitter.com/dkubb/status/608359066172313600
Dan Kubb@dkubb
.@rubyfive @_solnic_ has done great things for ruby, and your dismissive tone to his valid criticism only hurts the community.
Today at 12:44 PM
mbj [12:47 PM]
@dkubb
dkubb / sitemap.rb
Created Jun 27, 2014
Create a sitemap for supplied hostname and list of urls
View sitemap.rb
#!/usr/bin/ruby
require 'rubygems'
require 'mechanize'
require 'addressable/uri'
ROOT_URL = Addressable::URI.parse(ARGV.fetch(0)).freeze
# Disable SSL certificate verification
I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil
@dkubb
dkubb / Brewfile
Last active Aug 29, 2015
My Brewfile
View Brewfile
# Upgrade, Update, Check Homebrew
update
upgrade
doctor
# Install taps
tap caskroom/cask
tap sceaga/tap
# Install bash
@dkubb
dkubb / ssl.nginxconf
Last active Apr 11, 2019
Nginx SSL configuration (PFS, HSTS, SPDY, BREACH mitigation, FIPS compliant)
View ssl.nginxconf
ssl_certificate cert.pem;
ssl_certificate_key cert.key.pem;
ssl_trusted_certificate cert.ca.pem;
ssl_dhparam cert.dh.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers FIPS@STRENGTH:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
@dkubb
dkubb / axiom-mutant-coverage.txt
Last active Dec 27, 2015
Mutant Coverage for Axiom
View axiom-mutant-coverage.txt
Subjects: 440
Mutations: 8541
Kills: 8541
Runtime: 3773.23s
Killtime: 3670.90s
Overhead: 2.71%
Coverage: 100.00%
Alive: 0
You can’t perform that action at this time.