Skip to content

Instantly share code, notes, and snippets.

View joaomdmoura's full-sized avatar
🏠
Working from home

João Moura joaomdmoura

🏠
Working from home
View GitHub Profile
@joaomdmoura
joaomdmoura / fake_data.json
Last active August 29, 2015 14:25
Fake Data
##
## SCENARIO One Driver one Passenger (current_user) and Two pending invitations
##
# 1 Ride
{email: "[email protected]", password: "dtyyx", id: 3608}
{email: "[email protected]", password: "xxyjk", id: 3607}
# 2 Ride
{email: "[email protected]", password: "tsqyv", id: 3610}
@joaomdmoura
joaomdmoura / page_scrapper.rb
Last active December 29, 2016 20:45
Pure Old Ruby Object (PORO) HTML scraper with a simple DSL
require 'nokogiri'
require 'open-uri'
class PageScrapper
attr_accessor :url, :selector
IMG_SRC_REGEX = /src="([a-zA-Z\/0-9:.-_]+\.[a-zA-Z]{3})/
URL_REGEX = /http[s]?:\/\/[a-zA-Z0-9].+\.[a-z]{2,3}(\.[a-z]{2})?/
def initialize(url)
@joaomdmoura
joaomdmoura / enrich_csv_clearbit.rb
Last active August 17, 2021 20:46
Ruby script to enrich company data based on a email column in a CSV
# Before running this make sure you have Ruby installed
# preference to version > 2.4
#
# Also install the clearbit library, after the ruby
# installation, to do it you just run:
# $ gem install clearbit
#
# Then, you run a ruby console on the same directory of this file
# and the following commands:
#