This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #credit to: http://phrogz.net/simplest-possible-ruby-web-server | |
| ruby -rrack -e "include Rack;Handler::Thin.run Builder.new{run Directory.new''}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'terminal-table' | |
| def unpack_str_table(unpack_str, data = nil) | |
| len = unpack_str.scan(/\d+/) | |
| sum = 0; idx = 1 | |
| fields = len.map { |x| sum += x.to_i } | |
| headings = %w( Index Length Start End ) | |
| headings << "Data" unless data.nil? | |
| table = Terminal::Table.new :headings => headings | |
| fields.each do |stop| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "money" | |
| class Decorator < BasicObject | |
| undef_method :== | |
| def initialize(component) | |
| @component = component | |
| end | |
| def method_missing(name, *args, &block) |
NewerOlder