Skip to content

Instantly share code, notes, and snippets.

View Ranjithkumar's full-sized avatar

Ranjithkumar Ravi Ranjithkumar

View GitHub Profile
@r3bo0t
r3bo0t / download_wiki.rb
Created September 16, 2010 09:18
Ruby crawler file for downloading externallinks for mediawiki for diff languages
require 'hpricot'
require 'open-uri'
require 'work_queue'
dir = Dir.new("path/to/your/dir")
class DownloadWiki
def initialize
@locales = collect_locales
@host = "http://download.wikimedia.org/"
@Ranjithkumar
Ranjithkumar / user_common_logic.rb
Created September 24, 2010 06:40
User model common logics
module UserCommonLogic
def self.included(base)
base.extend ClassMethods
end
#Class methods
module ClassMethods
def authenticate(username, password)
u = find :first, :conditions => ['username = ?', username]