The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Trimming Off the Internet

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Trimming Off the Internet Posted: Aug 31, 2006 10:51 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Trimming Off the Internet
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Anyone wondering about MouseHole 2? Rany Keddo has posted some instructions for winding it up. And, along with that, he posts one of the first MouseHole 2 scripts out there.

Whitelist.rb, for using Mr. T to stop you from wandering when you’re working.

 class Whitelist < MouseHole::App
 name "whitelist" 
 namespace "purzelbaumcorp.de" 
 description "fend off the time thieves!" 
 version "0.1" 
 %w{mail.google.com corelib.rubyonrails.org blog.purzelbaumcorp.de}.
 each do |site|
 - url("http://#{site}/*")
 end
 + url("http://*")
 # the pages flow through here
 def rewrite(page)
 page.document.at("html").innerHTML= %{
 <body>
 <div style='text-align: center; margin-top:40px;'>
 <img src='http://www.doyouremember.co.uk/images/mr-t.gif' />
 <div style='font-size:27pt; color:#aaa;'>
 Pity the fool!
 </div></div>
 </body>
 }
 end
 end

If I may interject, the rewrite method could also be written:

 def rewrite(page)
 page.html do
 body do
 div :style => 'text-align: center; margin-top: 40px;' do
 img :src => 'http://www.doyouremember.co.uk/images/mr-t.gif'
 div "Pity the fool!", :style => 'font-size:27pt; color:#aaa;'
 end
 end
 end
 end

Oh, and, if you use this: please consider unblocking RedHanded! It’s not that distracting and it’s super-helpful. Right, guys?

Read: Trimming Off the Internet

Topic: Memory Inspector Previous Topic   Next Topic Topic: We are FAT (and secrets for losing weight)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use