Skip to content

Instantly share code, notes, and snippets.

View chrisseldo's full-sized avatar

Christopher Selden chrisseldo

View GitHub Profile
@chrisseldo
chrisseldo / parse_csv.rb
Last active October 28, 2015 03:47
CSV Read/Parse -- Ruby
require 'CSV'
read_csv = CSV.read(file_name)
headers = read_csv.shift.map {|i| i.to_s }
string_data = read_csv.map {|row| row.map {|cell| cell.to_s } }
array_of_hashes = string_data.map {|row| Hash[*headers.zip(row).flatten] }
(tag_header, tag_data) = [headers, array_of_hashes]
@chrisseldo
chrisseldo / index.html
Last active September 10, 2015 13:38
A live preview text editor
<!-- Basic comment/answer box setup -->
<textarea name="Answer" id="Answer" placeholder="Answer"></textarea>
<div id="livePre"></div>