Skip to content

Instantly share code, notes, and snippets.

View vicentereig's full-sized avatar
🐢

Vicente Reig vicentereig

🐢
View GitHub Profile
@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')
@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 / httpd.conf
Created August 10, 2012 10:20
Apache 2 + Proxy Balancer + Thin + Rails Asset Pipeline Development Environment for MacOSX
# These modules should be loaded by default: proxy_module, proxy_balancer_module, rewrite_module
Listen *:80
# You may want to keep the VirtualHost config under extra/*.conf
# Start your thin
<VirtualHost *:80>
ServerName wwww.yourawesomeapp.dev
@vicentereig
vicentereig / .pbrc
Created September 6, 2012 09:54
Simple .pythonbrewrc implementation
export PYTHONBREW_PROJECT_VENV='your_projects_venv'
export PYTHONBREW_PYTHON_VERSION='2.7.3'
@vicentereig
vicentereig / modello.rb
Created October 31, 2012 16:18
Sketching an ODT template generator
M::Document.configure do |config|
config.placeholder_format = "%:placeholder%"
end
class CustomerDetails
include M::DocumentFragment
include ActionView::Helpers::NumberHelper
subs :name, type: M::Text
subs :last_name, type: M::Text
@vicentereig
vicentereig / chart_wrapper.coffee
Last active December 10, 2015 12:19
avoiding inline JS
$ = jQuery
class GoogleChartWrapper
@defaults = {}
constructor: (@$el, @options={}) ->
$.extend true, @options, @defaults, @$el.data()
@chart = new google.visualization.ChartWrapper options
@chart.draw()
$.fn.chartWrapper = (options={}) ->
@each ->

Setting up dnsmasq for Local Web Development Testing on any Device

Please note, these instructions are for OS X Lion.

First, you need to get the IP address of your machine on your local network. In OS X, the easiest place to find this is in System Preferences > Network. If you're using DHCP on your local network, you will want to make sure your computer requests the same IP address when it renews it's IP address lease. I recommend configuring the DCHP Reservation settings on your router to accomplish this. Otherwise, you can specify a manual address in your network settings:

  1. Go to System Preferences > Network

  2. Click Advanced...

Ministerio de Fomento

6229 ORDEN FOM/956/2008, de 31 de marzo, por la que se aprueba la política de difusión pública de la información geográfica generada por la Dirección General del Instituto Geográfico Nacional.

La Dirección General del Instituto Geográfico Nacional, en adelante IGN, para llevar a cabo la misión de servicio público que tiene encomendada, genera y mantiene un importante volumen de información geográfica. De entre esta información geográfica destacan los datos que se ven reflejados en las series y bases cartográficas nacionales, en ortofotografías aéreas y ortoimágenes de satélites, y en fotogramas aéreos como

require 'grape'
class API < Grape::API
before do
@log_start_t = Time.now
Rails.logger.info " Parameters: #{params.to_hash.except("route_info")}"
end
after do
@log_end_t = Time.now
@vicentereig
vicentereig / sketch.md
Last active August 29, 2015 14:10
ember-cli-api-version-header
export default DS.RESTAdapter.extend({
    headers: {
        'Accept': 'application/vnd.impetu-v1+json'
    },
});
export default DS.RESTadapter.extend({