Skip to content

Instantly share code, notes, and snippets.

View sschimansky's full-sized avatar

Sebastian Schimansky sschimansky

  • ConsultiiQ GmbH
  • Goslar / Germany
View GitHub Profile
##############################################
# $Id: myUtilsTemplate.pm 7570 2015-01-14 18:31:44Z rudolfkoenig $
#
# Save this file as 99_myUtils.pm, and create your own functions in the new
# file. They are then available in every Perl expression.
package main;
use strict;
use warnings;
@sschimansky
sschimansky / hash.rb
Last active August 29, 2015 14:04
Hash#deep_underscore
class Hash
def deep_underscore(h = nil)
nh = {}
(h || self).each do |k,v|
nk = k.underscore
if v.is_a? Hash
puts "key #{k} recusive"
nh[nk] = deep_underscore v
elsif v.is_a? Array
nh[nk] = v.map do |eh|