This file contains 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
string = "| t%%> + ~+$ -+*> t% ~y r%%~, | s~%>&@ #|~ |$ -&@." | |
string = string.gsub(/[|]/, 'i') | |
#string = string.gsub(/[]/, '') | |
#string = string.gsub(/[]/, '') | |
#string = string.gsub(/[]/, '') | |
puts string |
This file contains 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
require 'win32/sound' | |
include Win32 | |
#count = 50 | |
Sound.beep(150, 5) | |
Sound.beep(200, 5) | |
Sound.beep(250, 5) | |
Sound.beep(300, 55) | |
Sound.beep(350, 125) | |
Sound.beep(400, 100) |
This file contains 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
#http://www.codegurl.com/2012/02/disguising-load-times-w-information.html | |
require 'nokogiri' | |
require 'open-uri' | |
def create_base_url(username) | |
#takes hub username and turns it into url using 'lastest' | |
base_url = "http://#{username}.hubpages.com/hubs/latest".to_s | |
end | |
def get_index_pages(base_url, username) |
This file contains 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
require 'nokogiri' | |
require 'open-uri' | |
=begin __ | |
/ _) | |
_.----._/ / | |
/ / | |
__/ ( | ( | | |
/__.-'|_|--|_| | |
http://hubpages.com/forum/topic/87923 |
This file contains 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
=begin | |
doctest: My hello method returns "Hello World!" | |
>> hello | |
=> "Hello World!" | |
doctest: I can pass a name to my hello method and get "Hello Melanie" | |
>> hello "Melanie" | |
=> "Hello Melanie!" | |
doctect: I can even ask a question by passing hello "Victor", "?" | |
>> hello("Victor", "?") | |
=>"Hello victor?" |
This file contains 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
<div class='post-header-line-1'/> | |
<b:if cond='data:blog.url == data:blog.homepageUrl'> | |
<!-- If user is on an index page--> | |
<div style='float:right;'> | |
AD CODE (size 125 x 125) | |
</div> | |
</b:if> | |
<b:if cond='data:blog.url != data:blog.homepageUrl'> | |
<!-- If user is on any page other than an index page --> |
This file contains 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
<div class="post-header-line-1"> | |
<div style="float: right;"> | |
AD CODE (size 200 x 200) | |
</div> |
This file contains 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/perl | |
use strict; | |
use warnings; | |
my $books = <<'END_OF_REPORT'; | |
1 The Well-Grounded Rubyist | |
2 Pragmatic Thinking & Learning | |
3 Programming Ruby 1.9 | |
4 Learning Perl | |
END_OF_REPORT |
This file contains 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
require 'nokogiri' | |
require 'open-uri' | |
def get_posts(url) | |
posts = [] | |
doc = Nokogiri::HTML(open(url)) | |
doc.css('link[rel=alternate]').each do |e| | |
posts << e['href'] | |
end | |
posts = posts.drop(1) |
This file contains 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
require 'sinatra' | |
require 'nokogiri' | |
require 'open-uri' | |
get '/serp_checker' do | |
"<form action='/ranked' method='post'> | |
<label for='keyword'>Keyword</label> | |
<textarea name='keyword' id='keyword' type='text' /></textarea> | |
<label for='url'>URL</label> | |
<input name='url' id='url' type='text' /> |