I hereby claim:
- I am drhuffman12 on github.
- I am drhuffman12 (https://keybase.io/drhuffman12) on keybase.
- I have a public key ASBPyKOg-p-18ANv6JCy3ywED_bb1obMMNe5rNls0dg4HQo
To claim this, I am signing this object:
| puts | |
| longest_key = ENV.keys.max_by(&:length) | |
| key_formatter = '%' + "#{longest_key.length}" + 's' | |
| puts "longest_key: '#{longest_key}'" | |
| puts "key_formatter: '#{key_formatter}'" | |
| puts "ENV:" | |
| puts | |
| ENV.each_pair do |k,v| | |
| puts "#{key_formatter % k}: #{v}" | |
| end |
| def stars(y,scale,char);y>0 ? char * ((y*scale).round) : '';end | |
| def curve(n);(0..n+1).each.collect{|x| y=Math.sin(Math::PI*2*x/n); [x, y]};end | |
| def star_set(y,scale,char_neg,char_zero,char_pos); yn = y < 0 ? stars(-y,scale,char_neg) : ''; yp = y > 0 ? stars(y,scale,char_pos) : ''; ("%#{scale.round.to_i}s" % yn) + char_zero + ("%-#{scale.round.to_i}s" % yp); end | |
| def star_set_def(y);star_set(y,10,'-','.','+');end | |
| puts curve(16).collect{|n| star_set_def(n[1])+" #{n[0]}, #{n[1]}\n"}.join('') | |
| =begin | |
| . 0, 0.0 | |
| .++++ 1, 0.3826834323650898 |
| class HashUtils | |
| # See also various flattening solutions at http://stackoverflow.com/questions/23521230/flattening-nested-hash-to-a-single-hash-with-ruby-rails | |
| def self.flatten_hash(param, prefix='') | |
| param.each_pair.reduce({}) do |a, (k, v)| | |
| v.is_a?(Hash) ? a.merge(flatten_hash(v, "#{prefix}#{k}.")) : a.merge("#{prefix}#{k}".to_sym => v) | |
| end | |
| end | |
| end | |
| class Hash |
| @folder_path = 'path/to/your/folder' | |
| Dir.glob(File.join(@folder_path,'*')).each {|f| File.open(f, 'w', crlf_newline: false) {|f| f.write(File.read(f).gsub("\r\n","\n") } };nil |
| #!/usr/bin/env ruby | |
| # USAGE: | |
| # $> ./xml_formatter path/from/my/file.xml | |
| # $> ./xml_formatter path/from/my/file.xml path/to/my/file_formatted.xml | |
| require 'nokogiri' | |
| in_file = ARGV[0] | |
| out_file = ARGV[1] |
| #!/usr/bin/env sh | |
| filter="$1" | |
| if [ -z "$1" ] | |
| then | |
| echo "Clean Docker containers and images based on given filter text." | |
| echo | |
| echo " Error: No filter argument supplied." | |
| echo " Usage: `basename "$0"` <filter>" | |
| echo " e.g. `basename "$0"` my_image_or_container_name" | |
| echo |
I hereby claim:
To claim this, I am signing this object:
| // xpath: '//*[@id="gists"]/div[2]/div[2]/div[2]/div' | |
| // selector: '#gists > div.js-gist-file > div.file.js-code-editor.container-preview.show-code > div.commit-create > div' | |
| // reset to orig: | |
| $('#gists > div.js-gist-file > div.file.js-code-editor.container-preview.show-code > div.commit-create > div').style.height = '352px' | |
| // expand to 600px high: | |
| $('#gists > div.js-gist-file > div.file.js-code-editor.container-preview.show-code > div.commit-create > div').style.height = '600px' | |
| // expand to 900px high: |
| # Remove all images by name | |
| export IMAGE_NAME | |
| IMAGE_NAME=<none> | |
| docker rmi -f `docker images -a | grep $IMAGE_NAME | awk '{print $3}'` |
| esha_pks = [6760530, 6776057, 7279784, 7370300, 8253591, 9797725, 10311137, 10455343, 11402152, 17796699, 18295998, 19227419, 21647821, 21868381, 22096443, 25284036, 32992254, 33039508, 35801083, 37408869, 37500344, 38846565, 44116874, 45503193, 45540890, 46292022, 46676413, 46997137, 48713161, 49538949, 52445686, 52668422, 55396354, 55749456, 56973217, 59940706, 66485593, 66941662, 67180364, 69097944, 70879458, 74598952, 74644922, 74715709, 81621084, 81864393, 82291812, 87092433, 91220972, 92292419, 92622167, 96111237, 96843940, 98217617, 98408699, 99470316, 102108591, 107904280, 108078113, 109046683, 110267344, 110684336, 112318653, 115528891, 115725084, 119023790, 119158512, 120247555, 123243383, 123817113, 124422809, 127195547, 129628259, 130922680, 134762489, 140120855, 143885669, 148806873, 149404244, 149810346, 149867253, 154129202, 160165198, 160803062, 163535839, 165656452, 167844561, 167987582, 168849158, 169287900, 169465839, 170000559, 170062431, 170281645, 179569209, 180810565, 181493232, 182530 |