This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = talha | |
email = [email protected] | |
[alias] | |
co = checkout | |
st = status | |
[editor] | |
editor = mate | |
[apply] | |
whitespace = nowarn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What I want: | |
<head> | |
... | |
<!-- the content of the partial --> | |
</head> | |
<body> | |
... | |
</body> | |
============== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### API ### | |
# LyrisMember | |
# SelectMember(email, list) | |
"http://lyris-servis.kaboose.com/[email protected]&list=kaboose_crafts" # [lyris_member, ...] | |
# EmailOnWhatLists(email) | |
"http://lyris-servis.kaboose.com/users/12345/lists" # returns [newsletter.to_xml, ...] | |
# CreateSingleMember(email, name, list) | |
"http://lyris-servis.kaboose.com/users" # POST request with list name, demographics etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
def k_means_cluster(clusters=[[]]) | |
# pp clusters | |
clusters_with_centroids = clusters.inject({}) do |centroids, cluster| | |
cluster_centroid = (cluster.inject(0.0) {|item, sum| sum+=item})/cluster.size | |
centroids[cluster_centroid] = cluster | |
centroids |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.macromates.textmate OakDefaultLanguage E00B62AC-6B1C-11D9-9B1F-000D93589AF6 |
OlderNewer