Skip to content

Instantly share code, notes, and snippets.

View mkuhnt's full-sized avatar

Markus Kuhnt mkuhnt

View GitHub Profile
Verifying that +mkuhnt is my blockchain ID. https://onename.com/mkuhnt
@mkuhnt
mkuhnt / stringify_keys.rb
Last active October 6, 2021 12:48
Deep Stringify Keys of hash even with embedded arrays
def transform_hash(original, options={}, &block)
original.inject({}){|result, (key,value)|
value = if (options[:deep] && Hash === value)
transform_hash(value, options, &block)
else
if Array === value
value.map{|v| transform_hash(v, options, &block)}
else
value
end
@mkuhnt
mkuhnt / MRI-1.9.3-p385-chef.sh
Created February 8, 2013 17:54
Bootstrap a vm with ruby MRI 1.9.3-p385 and chef.
#!/usr/bin/env bash
#
# Run me as sudo!
#
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
apt-get -y install autoconf curl git-core bzip2
apt-get -y autoremove
@mkuhnt
mkuhnt / MRI-1.9.3-p374-chef.sh
Last active December 12, 2015 02:48
Bootstrap a vm with ruby MRI 1.9.3-p374 and chef.
#!/usr/bin/env bash
#
# Run me as sudo!
#
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
apt-get -y install autoconf curl git-core bzip2
apt-get -y autoremove
@mkuhnt
mkuhnt / plain-server.sh
Created August 17, 2012 08:15
basic-plain-vanilla-server-setup-holy-gist
#!/usr/bin/env bash
#################################
# This file must be run as root #
#################################
# update the system and install core components
apt-get update
apt-get -y upgrade
apt-get install -y git-core build-essential zlib1g-dev openssl libcurl4-openssl-dev libopenssl-ruby libxslt-dev libxml2-dev libreadline-dev libpcre3 libpcre3-dev libyaml-dev