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
| def what_is_this | |
| puts 'Maybe Github Patie ?' | |
| 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 Question < ActiveRecord::Base | |
| has_one :answer | |
| has_many :suggestions | |
| def s_attributes=(s_attributes) | |
| s_attributes.each do |attr| | |
| suggestions.build(attr) | |
| end | |
| 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
| require 'rubygems' | |
| require 'mechanize' | |
| agent = WWW::Mechanize.new | |
| page = agent.get('http://google.com/') | |
| myfile = File.new('links.txt', 'w+') | |
| page.links.each do |link| | |
| myfile.puts(link.text) | |
| 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
| require 'rubygems' | |
| require 'hpricot' | |
| require 'open-uri' | |
| doc = Hpricot(open("http://google.com/")) | |
| myfile = File.new('links.html', 'w+') | |
| myfile.puts(doc.search("a[@href]")) |
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
| <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> | |
| <TITLE>302 Moved</TITLE></HEAD><BODY> | |
| <H1>302 Moved</H1> | |
| The document has moved | |
| <A HREF="http://www.google.bg/">here</A>. | |
| </BODY></HTML> |
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
| import htmllib | |
| import formatter | |
| import string | |
| import urllib, urlparse | |
| class myParser(htmllib.HTMLParser): | |
| def __init__(self, base): | |
| htmllib.HTMLParser.__init__(self, formatter.NullFormatter()) | |
| self.anchors = [] |
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
| <a href="index.php">Index</a> | |
| <a href="index.pdf">Index.pdf</a> | |
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
| require 'rubygems' | |
| require 'hpricot' | |
| require 'open-uri' | |
| doc = Hpricot(open("http://7thoughts.com/links.html")) | |
| myfile = File.new('links.html', 'w+') | |
| doc.search("a[@href]").each do |param| | |
| param = param.to_s | |
| unless param =~ /\.pdf/i | |
| myfile.puts(param) |
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
| defaults write -g AppleUseCoreUI -bool NO | |
| defaults write NSGlobalDomain NSUseLeopardWindowValues NO |
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
| count = 1 | |
| print 'Maximum: ' | |
| input = gets.to_i | |
| rand = rand(input) | |
| print "Guess :" | |
| guess = gets.to_i | |
| while (guess!=rand) | |
| if guess > rand | |
| puts "High Sky Try !" | |
| else |
OlderNewer