Skip to content

Instantly share code, notes, and snippets.

View avdgaag's full-sized avatar

Arjan van der Gaag avdgaag

View GitHub Profile
@avdgaag
avdgaag / command.sh
Last active December 9, 2015 23:49 — forked from anonymous/gist:4346624
Shell one-liner using Ruby to create a histogram from a log file.
export COL=$COLUMNS ; grep '\[CatalogItem\] Retrieved' production.log | awk '{ print $6 $7 }' | ruby -ne 'BEGIN { puts ENV.inspect;$columns = ENV["COL"].to_i; $all = Hash.new { |h,k| h[k] = 0 } }; a, b = $_.split("(").map(&:to_f); next if a < 1; $all[((b/a/100).floor)] += a.to_i; END { max_value = $all.values.max; puts "\e[2J\e[f"; puts "Average request time".center($columns); print "\033[37m" ; puts "ms/req ±50ms".center($columns); print "\033[0m" ; puts ("─" * $columns); $all.keys.sort.each { |k| puts "#{(k * 100 + 50).to_s.rjust(6)}: \033[31m#{"▓" * ($all[k].to_f / max_value * ($columns - 8))}\033[0m"; }; puts "─" * $columns; print "\033[5m\033[35m" ; puts "(╯°□°)╯︵ ┻━┻ © Arjan & Ariejan".center($columns); print "\033[0m" }'
@avdgaag
avdgaag / _media-queries.scss
Created May 29, 2012 10:54 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@avdgaag
avdgaag / .gitignore
Created February 13, 2012 14:46 — forked from karmi/.gitignore
Script to generate PDF cards suitable for planning poker from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export. Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/
.DS_Store
*.csv
*.pdf