Mechanize: Select an option from a dropdown field.
Mechanize works great for uploading data through forms: it has great support for manipulating text fields, check boxes, and so on. Selecting the appropriate option from a dropdown is slightly more...
View ArticleTiny quicksort implementation using Enumerable#select
A tiny quicksort implementation using Enumerable#select as partition method.
View ArticleHow to extract page links with Nokogiri.
A simple example which shows how to extract page links with Nokogiri using a css selector.
View ArticleSimple example DSL to generate HTML
A simple DSL implementation to generate html contents.
View ArticleDiscover if a number is prime.
The following is a neat way to determine if a number is prime or not extending the Fixnum class. Source: http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/
View ArticleA recursive OpenStruct, DeepStruct!
A recursive OpenStruct implementation by Andrea Pavoni which will take your hashes to build a fully recursive openstruct. http://andreapavoni.com/blog/2013/4/create-recursive-openstruct-from-a-ruby-hash
View ArticleQuery Google Analytics with Garb
This snippet will query Google Analytics API to obtain unique views of specified paths, using the Garb gem at http://rubygems.org/gems/garb
View ArticleHow to make DNS queries with Ruby.
How to make DNS queries with Ruby using the "resolv" library, for a complete documentation of request types refer to http://www.ruby-doc.org/stdlib-2.0/libdoc/resolv/rdoc/Resolv/DNS/Resource.html .
View ArticleMangaEden scan downloader.
A simple script to bulk download manga scans from http://www.mangaeden.com/ .
View ArticleCreate a collage with multiple images.
Using the RMagick ruby gem you can create an image composition using multiple images with ease.
View ArticleSimulate the .NET "using" keyword in Ruby.
An implementation of the "using" keyword and Disposable interface of the .NET programming languages in Ruby.
View ArticlePost an article to WordPress using Ruby and XMLRPC
How to post an article to a WordPress blog using Ruby and XMLRPC.
View ArticleSinatra example application.
An example application using Sinatra, the minimal web application framework for Ruby.
View Article