Skip to content

Instantly share code, notes, and snippets.

View talhasyed's full-sized avatar

Talha Umer Syed talhasyed

View GitHub Profile
require 'rubygems'
gem 'nokogiri'
require 'nokogiri'
require 'open-uri'
require 'pp'
urls = [
"http://www.kaboose.com/speed_test.html",
"http://parenting.kaboose.com/index_speed_test.html",
What I want:
<head>
...
<!-- the content of the partial -->
</head>
<body>
...
</body>
==============
require 'csv'
file = "db/commission_junction/2087028_18584_20080827.csv"
cols, *rows = CSV::Reader.parse(File.open(file)).to_a
collection = rows.collect { |row| Hash[*cols.zip(row).flatten] }
puts collection.first.inspect
@talhasyed
talhasyed / tps.rb
Created January 29, 2009 15:25
tps report generator
require 'rubygems'
gem 'hpricot'
require 'hpricot'
require 'date'
Author = 'talha'
Svns = {
:local => "svn+ssh://svn.bubbleshare.com/svn/local/",
:bluedash => "svn+ssh://svn.bubbleshare.com/svn/admin/",
:csp => "svn+ssh://svn.bubbleshare.com/svn/csp/",
# CocoaMySQL dump
# Version 0.7b4
# http://cocoamysql.sourceforge.net
#
# Host: localhost (MySQL 5.0.37)
# Database: slideshow
# Generation Time: 2009-01-28 13:04:19 -0500
# ************************************************************
# Dump of table slides
# CocoaMySQL dump
# Version 0.7b4
# http://cocoamysql.sourceforge.net
#
# Host: localhost (MySQL 5.0.37)
# Database: slideshow
# Generation Time: 2009-01-28 12:04:41 -0500
# ************************************************************
# Dump of table sidebar_modules
[user]
name = talha
email = [email protected]
[alias]
co = checkout
st = status
[editor]
editor = mate
[apply]
whitespace = nowarn