var
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 '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) |
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
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 |
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
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 |
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
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. |
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
madrid = Site.find_by(domain: 'madrid.gobify.net') | |
# Create users | |
idx = 1 | |
users = [] | |
20.times do | |
gender = (idx <= 7) ? 'male' : 'female' |
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
def next_poll(current_site, current_user, poll_id = nil) | |
poll = GobiertoParticipation::Poll.by_site(current_site).find(poll_id) if poll_id | |
answerable_polls = GobiertoParticipation::Poll.by_site(current_site).answerable.order(ends_at: :asc) | |
answerable_polls_by_user = answerable_polls.detect { |p| p.answerable_by?(current_user) } if current_user | |
if current_user | |
if poll && poll.answerable_by?(current_user) | |
poll | |
elsif answerable_polls_by_user | |
answerable_polls_by_user |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<!-- GENCAT META --> | |
<!----> | |
<title>Funció pública. Govern obert</title> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://governobert.gencat.cat/web/resources/fwkResponsive/fpca_capcalera/js/fpca_capcalera.js" type="text/javascript"></script> | |
<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> | |
</head> |
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
{ | |
"scheming_version": 1, | |
"dataset_type": "dataset", | |
"about": "A reimplementation of the default CKAN dataset schema", | |
"about_url": "http://github.com/ckan/ckanext-scheming", | |
"dataset_fields": [ | |
{ | |
"field_name": "title", | |
"label": "Title Wadus", | |
"preset": "title", |
OlderNewer