Skip to content

Instantly share code, notes, and snippets.

View saramic's full-sized avatar
🚀

Michael Milewski saramic

🚀
View GitHub Profile

Keybase proof

I hereby claim:

  • I am saramic on github.
  • I am saramic (https://keybase.io/saramic) on keybase.
  • I have a public key ASD9cA9Dce_ztUWlc8FziT_nYn_vM1b1I0xENEAare4oEQo

To claim this, I am signing this object:

@saramic
saramic / gist:4718702
Created February 5, 2013 23:29
from the command line get the lastest 10 emails from GMail and print the from email address. assumes ruby and rubygems are installed.
# based on http://dcparker.github.com/ruby-gmail/
# get latest 10 email addresses from GMail inbox emails
gem install gmail
export USRENAME=my_name PASSWORD=my_password
ruby -e 'require "rubygems"; require "gmail"; \
Gmail.new(ENV["USERNAME"], ENV["PASSWORD"]){|gmail| \
gmail.inbox.emails.each_with_index{|email, index| \
@saramic
saramic / home_idea_count.rb
Created October 13, 2011 22:47
count images on REA home ideas
require 'nokogiri'
require 'open-uri'
spaces = []
doc = Nokogiri::HTML(open('http://www.realestate.com.au/home-ideas'))
doc.css('nav.hi-main-nav>ul>li>a').each do |anchor|
space = anchor.attribute('href')
space_url = 'http://www.realestate.com.au' + space.text.sub('space', 'results') + "/list-1"
doc_list = Nokogiri::HTML(open(space_url))
spaces << {