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 'json' | |
require 'open-uri' | |
require 'json-schema' | |
schema = JSON.load(open("http://popoloproject.com/schemas/person.json#")) | |
JSON::Validator.cache_schemas = true | |
JSON.load(open("https://raw.github.com/tmtmtmtm/eduskunta-popolo/master/people.json")).each do |person| |
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
#!/usr/bin/env node | |
var fs = require('fs') | |
, path = require('path') | |
, walk = require('walk') | |
, shp = require('shp'); | |
if (process.argv.indexOf('--help') !== -1 || process.argv.indexOf('-h') !== -1) { | |
console.log('Usage: geojson.js [input directory] [output directory]'); | |
process.exit(0); |
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
module Subscriptions | |
module Adapters | |
class Base | |
class << self | |
# One of "bill", "document", "opinion", "regulation", "speech", "state_bill", "state_legislator" or nil. | |
ITEM_TYPE = nil | |
# Whether the adapter supports searching. | |
SEARCH_ADAPTER = false | |
# Whether the adapter supports subscriptions only. | |
ITEM_ADAPTER = false |
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 'csv' | |
require 'open-uri' | |
data_catalogs = {} | |
rows = CSV.parse(open('https://raw.github.com/opencivicdata/ocd-division-ids/master/identifiers/country-ca/ca_municipal_subdivisions-data_catalog.csv').read) | |
rows.shift | |
rows.each do |id,data_catalog| | |
data_catalogs[id[/[^:]+\z/]] = data_catalog | |
end |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# @see http://linfiniti.com/2011/12/vector-transparency-plugin-for-qgis/ | |
layer = iface.mapCanvas().currentLayer() | |
layer.setLayerTransparency(50) # int between 0 and 100 | |
iface.mapCanvas().refresh() |
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
HTTP methods: | |
5 CONNECT | |
10 PUT | |
47 PROPFIND | |
1962 POST | |
97097 null | |
97115 OPTIONS | |
102141 HEAD | |
2901012 GET |
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 'open-uri' | |
require 'nokogiri' | |
status = Hash.new(0) | |
Nokogiri::HTML(open('https://opencorporates.com/')).css('#facets a').each do |a| | |
Nokogiri::HTML(open("https://opencorporates.com#{a[:href]}")).css('.current_status li').each do |li| | |
status[li.at_css('a').text.strip] += Integer(li.at_css('span').text.strip.gsub(',', '')) | |
end | |
end |
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
source 'https://rubygems.org' | |
gem 'pupa', '~> 0.1.1' |
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
diff --git a/app/assets/javascripts/rangeslider.js b/app/assets/javascripts/rangeslider.js | |
index 1531b77..9637194 100644 | |
--- a/app/assets/javascripts/rangeslider.js | |
+++ b/app/assets/javascripts/rangeslider.js | |
@@ -107,7 +107,7 @@ | |
this.identifier = 'js-' + pluginName + '-' +(pluginIdentifier++); | |
this.min = parseFloat(this.$element[0].getAttribute('min') || 0); | |
this.max = parseFloat(this.$element[0].getAttribute('max') || 100); | |
- this.value = parseFloat(this.$element[0].value || this.min + (this.max-this.min)/2); | |
+ this.value = parseFloat(this.$element[0].getAttribute('value') || this.min + (this.max - this.min) / 2); |
OlderNewer