Step 0: Open Automator, New Service.
Step 1: Drag out Run Shell Script action. Pass Input to STDIN
Step 2: This code:
open `gist`
| BOBO!!! |
| IT WORKS!!!! |
| hello |
| def primary_comment | |
| if self.visits.count > 1 | |
| output = s"<details class='primary_comment'>" | |
| output << helpers.content_tag(:summary, {}, nil, false) { | |
| s("<h3>", Present(self.comments.last).url_span, " (and #{self.comments.count - 1} others)</h3>") | |
| } | |
| output << helpers.content_tag(:ul) do | |
| self.comment[0...-1].collect { |comment| s(Present(comment).comment_li) }.join("\n") |
| def s(*args) | |
| output = "".html_safe | |
| args.each {|current_arg| | |
| output << current_arg.html_safe | |
| } | |
| output | |
| end | |
| # The Specs for said function |
| This is a test |
| Hello world | |
| this is a long gist | |
| well kind of, I'm testing something |
| # Info: Rails 3.1.1 | |
| class BusinessesController < ApplicationController | |
| helper_method :business | |
| # [snip controller crap] | |
| def business | |
| @business ||= Business.find(params[:id]) | |
| end |
| #!/usr/bin/env ruby | |
| print ARGF.read.match(/<#(.+)#/)[1] |