Skip to content

Instantly share code, notes, and snippets.

@danpariente
danpariente / rspec-syntax-cheat-sheet.rb
Created December 4, 2012 20:14 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@danpariente
danpariente / spanish_stop_words.txt
Created October 9, 2012 16:51
Spanish Stop Words
de
la
que
el
en
y
a
los
del
se
@danpariente
danpariente / fb_search_crawler.rb
Created October 1, 2012 12:55
Facebook Search Crawler
require 'mechanize'
agent = Mechanize.new
page = agent.get('https://m.facebook.com/')
login_form = page.forms.first
login_form.email = "user@mail.com"
login_form.pass = "password"
main_page = agent.submit(login_form, login_form.buttons.first)
@danpariente
danpariente / gist:3457157
Created August 24, 2012 23:27
News Classifier
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'rss/2.0'
class RssParser
attr_accessor :url
def initialize(url)
@url = url
@danpariente
danpariente / gist:3457126
Created August 24, 2012 23:24
Automated User Chat Room Creator
require 'mechanize'
class ChatRoomConnector
attr_accessor :generated_password, :username, :email
def initialize(username)
@username = username
@email = ""
@generated_password = ""
@agent = Mechanize.new