Skip to content

Instantly share code, notes, and snippets.

View dkubb's full-sized avatar
🏠
Working from home

Dan Kubb dkubb

🏠
Working from home
  • Betterment
  • Mission, BC, Canada
  • X @dkubb
View GitHub Profile
### Keybase proof
I hereby claim:
* I am dkubb on github.
* I am dkubb (https://keybase.io/dkubb) on keybase.
* I have a public key ASABdYDarQ43GiNGY274zzSheBhF9a6SCfzdVInw3nb_ogo
To claim this, I am signing this object:
@dkubb
dkubb / money.rb
Last active January 13, 2017 01:39
A modern ruby Money class
require 'bigdecimal'
require 'bigdecimal/util'
require 'rubygems'
require 'adamantium'
require 'concord'
class Money
include Adamantium, Concord.new(:amount), Comparable
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]
#
#!/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 August 29, 2015 14:25
Create Statically Linked Haskell Binaries
*.hi
*.o
*.sw[op]
/.shake
/.stack-work
/dist
/output
@dkubb
dkubb / gist:e2763e1bd1047ab0bcd6
Last active August 29, 2015 14:22
Slack Conversation about Ruby5 comments
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 June 27, 2014 23:19
Create a sitemap for supplied hostname and list of urls
#!/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 August 29, 2015 14:01
My Brewfile
# Upgrade, Update, Check Homebrew
update
upgrade
doctor
# Install taps
tap caskroom/cask
tap sceaga/tap
# Install bash
@dkubb
dkubb / ssl.nginxconf
Last active April 11, 2019 03:56
Nginx SSL configuration (PFS, HSTS, SPDY, BREACH mitigation, FIPS compliant)
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;