Skip to content

Instantly share code, notes, and snippets.

View MicTech's full-sized avatar
😎
make product people want

Michal Těhník MicTech

😎
make product people want
View GitHub Profile
@MicTech
MicTech / config.ru
Created December 27, 2017 09:34
The Rack::TryStatic middleware delegates requests to Rack::Static middleware trying to match a static file
# config.ru
# The Rack::TryStatic middleware delegates requests to Rack::Static middleware
# trying to match a static file
#
# Inspired by original code from rack-contrib
# http://github.com/rack/rack-contrib/blob/master/lib/rack/contrib/try_static.rb
#
module Rack
module CodeRetreat
open Xunit
type Cell =
| DeadCell of int
| LiveCell of int
let hasChanceToLife (cell:Cell) =
match cell with
@MicTech
MicTech / hash_deep_diff.rb
Created December 27, 2017 09:35
Recursively diff two Ruby hashes.
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
# Example:
#
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {