This file contains 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
#!/usr/bin/env ruby | |
def run max | |
return unless max > 1 | |
return (2 .. max).inject([]) do |r, i| | |
if i.even? | |
r << i if i == 2 | |
else | |
composite = false |
This file contains 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' | |
SOURCE_CSV = "data.csv" | |
OUTPUT_SQL = "#{Time.now.to_a.first(6).reverse.join}.sql" | |
OUTPUT_DB = OUTPUT_SQL + ".db" | |
data_array = CSV.read(SOURCE_CSV, :quote_char => "'", :col_sep =>',', :row_sep =>:auto) | |
header_array = data_array.delete_at(0).map { |h| h.downcase.gsub(" ", "_") } | |
header_string = header_array.join(", ") |
NewerOlder