puts Rack::Utils::HTTP_STATUS_CODES.sort.to_yaml
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
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Controllers | 544 | 412 | 21 | 65 | 3 | 4 | | |
| | Helpers | 64 | 46 | 0 | 13 | 0 | 1 | | |
| | Models | 761 | 566 | 20 | 91 | 4 | 4 | | |
| | Libraries | 21 | 17 | 1 | 2 | 2 | 6 | | |
| | Model specs | 391 | 305 | 0 | 0 | 0 | 0 | | |
| | Mailer specs | 0 | 0 | 0 | 0 | 0 | 0 | | |
| | Acceptance specs | 1043 | 767 | 2 | 16 | 8 | 45 | |
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
| next_url = 'http://google.com' | |
| redirection = proc do |env| | |
| [ 301, {'Content-Type' => 'text', 'Location' => next_url}, ["301 - redirected to #{next_url}"] ] | |
| end | |
| run redirection |
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
| #!/usr/bin/env ruby | |
| # | |
| # Joins paragraphs so that they span one long line. | |
| # Quoted or indented text are left untouched. | |
| # Useful for Gmail. | |
| # | |
| open('| pbcopy', 'w') do |pbcopy| | |
| pbcopy.write(`pbpaste`.gsub(/([^>\n])\n(\w)/, '\\1 \\2')) | |
| end |
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
| class AppServerConfiguration | |
| attr_accessor :port, :admin_password | |
| end | |
| class Configuration | |
| attr_accessor :tail_logs, :max_connections, :admin_password | |
| def initialize(block) | |
| block.call(self) |
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
| # works with ruby1.9 | |
| require 'rubygems' | |
| require 'redcarpet' | |
| text = <<fenced | |
| Now let's see some fancy CSS: | |
| ~~~.css | |
| #foo{ | |
| border-top: #000; /* yeah, black */ |
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
| <!doctype html> | |
| <html lang=en> | |
| <head> | |
| <title>z-index test</title> | |
| <meta charset=utf-8> | |
| <style type="text/css" media="screen"> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| } |
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
| <!doctype html> | |
| <html lang=en> | |
| <head> | |
| <title>quick'n'dirty js testing framework</title> | |
| <meta charset=utf-8> | |
| <style type="text/css" media="screen"> | |
| p { font: .8em courier; padding: .5em 1em; margin: 0;} | |
| .pass { color: #4F8A10; background: #DFF2BF } | |
| .fail { color: #D8000C; background: #FFBABA } | |
| .error{ color: white; background: red } |
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
| <!doctype html> | |
| <html lang=en> | |
| <head> | |
| <title>CSS3 gradient background in short page</title> | |
| <meta charset=utf-8> | |
| <style type="text/css" media="screen"> | |
| html{ | |
| height: 100%; | |
| } | |
| body{ |
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
| > gem install rails --pre | |
| /Users/raul/.rvm/rubies/ruby-1.9.2-p0/bin/gem:4: warning: Insecure world writable dir /usr/local in PATH, mode 040777 | |
| ERROR: While executing gem ... (NameError) | |
| uninitialized constant Syck::Syck | |
| > gem install rails -v ">=3.1.0rc" | |
| /Users/raul/.rvm/rubies/ruby-1.9.2-p0/bin/gem:4: warning: Insecure world writable dir /usr/local in PATH, mode 040777 | |
| Building native extensions. This could take a while... | |
| Successfully installed activesupport-3.1.0.rc1 |