Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
| #!/usr/local/bin/macruby | |
| # Copyright (c) 2009 Matt Aimonetti | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: |
| class Enumerator | |
| class Error < Struct.new(:error) | |
| end | |
| def feed(v) | |
| @feed = v | |
| end | |
| class StopIteration < ::StopIteration | |
| attr :result | |
| def initialize(msg, result) | |
| super(msg) |
| <!doctype html><html><head><meta charset="UTF-8"><title>Tetris</title></head> | |
| <body> | |
| <pre id='game'></pre> | |
| <script> | |
| var tetris = { | |
| empty:0,board:0,block:0,position:0,offset:0, | |
| binary: function(i){ | |
| return (i).toString(2); | |
| }, | |
| init: function(){ |
| system ~/projects/gc_tests $ rvm 1.9.3 do ruby gc_stress.rb | |
| 20.760000 0.250000 21.010000 ( 21.007255) | |
| {:count=>7921, | |
| :heap_used=>43, | |
| :heap_length=>43, | |
| :heap_increment=>0, | |
| :heap_live_num=>5607, | |
| :heap_free_num=>11963, | |
| :heap_final_num=>1} | |
| GC time: 2.259033000000017s |
| #!/usr/bin/env ruby | |
| # A simply utility to show character counts for each line of input and | |
| # highlight lines longer than 80 characters. | |
| # | |
| # Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html | |
| # | |
| # Examples: | |
| # | |
| # $ hilong Gemfile |
| framework 'Cocoa' | |
| framework 'QuartzCore' | |
| class NSColor | |
| def toCGColor | |
| colorRGB = self.colorUsingColorSpaceName NSCalibratedRGBColorSpace | |
| components = Array.new(4){Pointer.new(:double)} | |
| colorRGB.getRed components[0], green:components[1], blue:components[2], alpha:components[3] |
| require "thread" | |
| $mutex = Mutex.new | |
| $total = 0 | |
| def incr | |
| $mutex.synchronize { $total += 1 } | |
| sleep | |
| end |
| system ~/projects/jruby $ jruby -rjruby/thread_dump -e "Thread.new{ loop{ 'hello' } }.join" | |
| ^Z | |
| [1]+ Stopped jruby -rjruby/thread_dump -e "Thread.new{ loop{ 'hello' } }.join" | |
| system ~/projects/jruby $ bg | |
| [1]+ jruby -rjruby/thread_dump -e "Thread.new{ loop{ 'hello' } }.join" & | |
| system ~/projects/jruby $ kill -USR2 %1 ; sleep 1 | |
| Ruby Thread Dump |