Skip to content

Instantly share code, notes, and snippets.

View vicentereig's full-sized avatar
🐢

Vicente Reig vicentereig

🐢
View GitHub Profile
@vicentereig
vicentereig / ruby_csv_simple_object_mapping.rb
Last active October 7, 2015 15:38
Awesome FasterCSV Features. Thanks @JEG2
# http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html#method-c-load
# http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html#method-c-dump
# https://github.com/JEG2/faster_csv/blob/master/test/tc_serialization.rb
require 'csv'
class Person
attr_accessor :id, :name, :email
def self.csv_load(meta, headers, row)
person = Person.new
@vicentereig
vicentereig / epsg_25831_to_latlon.rb
Created March 28, 2012 09:18
EPSG:25831 to latlon
# To get this gist running use Ruby 1.9.2 or greater and:
# brew install proj
# gem install proj4rb
#
# http://spatialreference.org/ref/epsg/25831/
require 'proj4'
utm_point = Proj4::Point.new(43718.773, 72605.572)
utm30 = Proj4::Projection.new(proj: "utm", zone: "30", units: "m", ellps: 'intl')