@human_size = (bytes)->
  exp = Math.log(bytes) / Math.log(1024) | 0
  result = (bytes / Math.pow(1024, exp))
  precision = if result < 0 then 2 else 1
  result = result.toFixed(precision)
  addition =  if exp is 0 then "bytes" else "KMGTPEZY"[exp - 1] + "B"
  "#{result} #{addition}"
Dunlop.register_setup 'human-size', (target) ->
  target.find('[data-bytes]').each ->
    display = $(@)
    display.text human_size(display.data('bytes'))
