Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/bin/sh | |
| # Convert ANSI (terminal) colours and attributes to HTML | |
| # Licence: LGPLv2 | |
| # Author: | |
| # http://www.pixelbeat.org/docs/terminal_colours/ | |
| # Examples: | |
| # ls -l --color=always | ansi2html.sh > ls.html | |
| # git show --color | ansi2html.sh > last_change.html |
| # In response to: | |
| # http://mlomnicki.com/ruby/tricks-and-quirks/2011/02/10/ruby-tricks2.html | |
| # Ruby 1.9.2 has some neat stuff that lets us make a readable | |
| # alternative case statement that calls each method in turn. | |
| # 1.9.2 features used: | |
| # * hashes are ordered in 1.9.2 | |
| # * cool JSON-style hash syntax | |
| # * concise lambda syntax |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # This goes in config/locales/en.rb (*not* en.yml) | |
| { | |
| :en => { | |
| :time => { | |
| :formats => { | |
| :full => lambda { |time, _| "%H:%M | %A, #{time.day.ordinalize} %B %Y" } | |
| } | |
| } | |
| } | |
| } |
| require 'terminal-table/import' | |
| class SubsetSumMatrix | |
| class << self | |
| def create_empty_for(array) | |
| matrix = [] | |
| header = [nil] + build_header_from(array) | |
| matrix << header | |
| array.each_with_index do |element,i| | |
| row = header.collect{|value| 'F'} |