Skip to content

Instantly share code, notes, and snippets.

View amiedes's full-sized avatar
🏠
Working from home

Alberto Miedes Garcés amiedes

🏠
Working from home
View GitHub Profile
@amiedes
amiedes / seed-poll-results.rb
Created November 1, 2017 17:59
seed poll results in staging
madrid = Site.find_by(domain: 'madrid.gobify.net')
# Create users
idx = 1
users = []
20.times do
gender = (idx <= 7) ? 'male' : 'female'
@amiedes
amiedes / gobierto-test-output
Created February 18, 2017 17:37
gobierto test output
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.3-compliant syntax, but you are running 2.3.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
== Deleting budgets-forecast-v3 index ==
== Deleting budgets-execution-v3 index ==
== Deleting tbi-collections index ==
== Deleting data index ==
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.3-compliant syntax, but you are running 2.3.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
@amiedes
amiedes / index.md
Created February 4, 2017 10:51
Webmapping Gist

Foo

var

@amiedes
amiedes / datos_trayectos.sql
Created May 17, 2016 08:25
OrientDB queries to create connections between metro stops
CREATE EDGE Trayecto FROM (SELECT FROM Parada WHERE nombre = 'Moncloa' and linea = 3) to (SELECT FROM Parada WHERE nombre = 'Argüelles' and linea = 3) CONTENT { "distancia" : 2 }
CREATE EDGE Trayecto FROM (SELECT FROM Parada WHERE nombre = 'Argüelles' and linea = 3) to (SELECT FROM Parada WHERE nombre = 'Ventura Rodriguez' and linea = 3) CONTENT { "distancia" : 2 }
CREATE EDGE Trayecto FROM (SELECT FROM Parada WHERE nombre = 'Ventura Rodriguez' and linea = 3) to (SELECT FROM Parada WHERE nombre = 'Plaza de España' and linea = 3) CONTENT { "distancia" : 3 }
CREATE EDGE Trayecto FROM (SELECT FROM Parada WHERE nombre = 'Plaza de España' and linea = 3) to (SELECT FROM Parada WHERE nombre = 'Callao' and linea = 3) CONTENT { "distancia" : 2 }
CREATE EDGE Trayecto FROM (SELECT FROM Parada WHERE nombre = 'Callao' and linea = 3) to (SELECT FROM Parada WHERE nombre = 'Sol' and linea = 3) CONTENT { "distancia" : 4 }
CREATE EDGE Trayecto FROM (SELECT FROM Parada WHERE nombre = 'Sol' and linea = 3) to (SELECT FROM Parada
@amiedes
amiedes / datos_paradas.sql
Last active May 17, 2016 10:08
OrientDB queries to create metro stops
CREATE VERTEX Parada CONTENT { "nombre" : 'Alto Del Arenal', "linea" : 1, "latitud" : 40.389768700352434 , "longitud" : -3.6452252835565764 }
CREATE VERTEX Parada CONTENT { "nombre" : 'Alvarado', "linea" : 1, "latitud" : 40.45033105413335 , "longitud" : -3.7033178070796913 }
CREATE VERTEX Parada CONTENT { "nombre" : 'Anton Martin', "linea" : 1, "latitud" : 40.41246302818812 , "longitud" : -3.6993757416732405 }
CREATE VERTEX Parada CONTENT { "nombre" : 'Atocha', "linea" : 1, "latitud" : 40.408846792956474 , "longitud" : -3.692490883566612 }
CREATE VERTEX Parada CONTENT { "nombre" : 'Atocha Renfe', "linea" : 1, "latitud" : 40.406586090726144 , "longitud" : -3.689379993715528 }
CREATE VERTEX Parada CONTENT { "nombre" : 'Bambu', "linea" : 1, "latitud" : 40.47680705593772 , "longitud" : -3.6763772762447107 }
CREATE VERTEX Parada CONTENT { "nombre" : 'Bilbao', "linea" : 1, "latitud" : 40.42904963582931 , "longitud" : -3.702188295886296 }
CREATE VERTEX Parada CONTENT { "nombre" : 'Buenos Aires', "linea
@amiedes
amiedes / http.rb
Created May 17, 2016 08:23
Ruby script to make HTTP requests to OrientDB REST API
require 'net/http'
require 'json'
def print_response_body(response)
body = JSON.parse(response.body)
pretty_body = JSON.pretty_unparse(body)
puts pretty_body
end
def make_request(uri, request)