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
| source 'http://rubygems.org' | |
| gem 'rails','2.3.12' | |
| gem 'bundler','1.1.5' | |
| gem 'json','1.7.5' | |
| gem 'rdoc', '3.12' | |
| gem 'mysql2', '0.2.19b4' | |
| gem 'activerecord-mysql2-adapter' | |
| gem 'haml' | |
| gem 'sass' |
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
| binding=Struct.new(:key) do | |
| def get_binding | |
| binding | |
| end | |
| end.new("value").get_binding | |
| data = YAML::load(ERB.new(File.read("file.yml")).result(binding)) |
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
| r=/".+"/; puts File.readlines("file.txt").sort{|a,b| a[r] <=> b[r]} |
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 "bson" | |
| def make_insert(table_name, bson) | |
| columns = ["id",*bson["value"].keys] * ", " | |
| values = ["'#{bson["_id"]}'",*bson["value"].values.map{|value| value.is_a?(Numeric) ? value : "'#{value}'"}] * ", " | |
| return "insert into #{table_name} (#{columns}) values (#{values});" | |
| end | |
| file_name = ARGV.first | |
| file=File.new(file_name) |
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
| AFRICA=[ | |
| "Algeria", | |
| "Angola", | |
| "Benin", | |
| "Botswana", | |
| "Burkina", | |
| "Burkina Faso", | |
| "Burundi", | |
| "Cameroon", | |
| "Cape Verde", |