I hereby claim:
- I am kalmbach on github.
- I am kalmbach (https://keybase.io/kalmbach) on keybase.
- I have a public key ASB3JdjSXH24vM0HNwGt8f2Y9S_2H-HjvDTLO3sKHyTnHQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/ruby | |
| # Ruby already has a 'flatten' method in the Array class | |
| # [[1,2,[3]],4].flatten -> [1,2,3,4] | |
| # | |
| # I did my own implementation as an exercise | |
| module Code | |
| def ruby_flatten(ary) | |
| ary.flatten if ary.respond_to? :flatten | 
| module Rack | |
| module Session | |
| class Flash | |
| def initialize(app) | |
| @app = app | |
| end | |
| def call(env) | |
| dup.call!(env) | |
| end | 
| namespace :db do | |
| require "sequel" | |
| Sequel.extension :migration | |
| DB = Sequel.connect(ENV['DATABASE_URL']) | |
| desc "Prints current schema version" | |
| task :version do | |
| version = if DB.tables.include?(:schema_info) | |
| DB[:schema_info].first[:version] | |
| end || 0 | 
| class Date | |
| # Extend Date Class with some custom methods | |
| # Returns the name of the week day. | |
| # | |
| # Date.today.weekday | |
| # -> 'Monday' | |
| def weekday | |
| self.strftime("%A") |