Skip to content

Instantly share code, notes, and snippets.

View marciuz's full-sized avatar

Marcello Verona marciuz

View GitHub Profile
# -*- coding: utf-8 -*-
"""
***************************************************************************
QGIS Server Plugin Filters: this test filter adds a CSS to HTML
get feature info response.
---------------------
Date : April 2015
Copyright : (C) 2015 by Alessandro Pasotti
Email : apasotti at gmail dot com
Processed 10 (10 created, 0 updated, 0 failed, 0 ignored) in 30.9 sec (19/min) - done with 'dkan_harvest_migrate_dati_veneto' [completed]
Timer Cum (sec) Count Avg (msec)
page 34.396 1 34396.19
destination import 30.762 10 3076.162
file_field_presave 8.698 51 170.558
field_attach_update 2.658 44 60.418
field_sql_storage_field_storage_write 2.214 74 29.919
search_api_entity_insert 1.373 90 15.251
MigrateFieldsEntityHandler->prepare 1.25 10 124.979
MigrateDestinationEntity->prepareFields 1.25 10 124.951
@marciuz
marciuz / Install-datigov.sh
Created December 13, 2016 09:08
Installazione e prime customizzazioni di DKAN - DatiGov
#!/bin/sh
# Info da http://docs.getdkan.com/dkan-documentation/dkan-developers-guide/installing-dkan
git clone --branch 7.x-1.x https://github.com/marciuz/dkan.git dkan
cd dkan
drush make --prepare-install drupal-org-core.make webroot --yes
rsync -av . webroot/profiles/dkan --exclude webroot
drush -y make --no-core --contrib-destination=./ drupal-org.make webroot/profiles/dkan --no-recursion
cd webroot
field_license_value n
Creative Commons Attribution 6028
Italian Open Data License 2.0 1214
http://www.dati.gov.it/iodl/2.0/ 1167
Creative Commons Attribuzione 397
Creative Commons CCZero 396
Creative Commons Attribution - CC-BY 301
Italian Open Data License v2.0 244
Creative Commons Attribution 4.0 (CC BY 4.0) 232
notspecified 125
@marciuz
marciuz / calendar_table_ita.sql
Created December 14, 2016 23:27
Italian version. The script create a calendar table, a useful tool for many databases. It is useful and quicker then create on the fly dates.
--
-- CALENDAR TABLE - Versione Italiana dello script descritto su
-- https://www.brianshowalter.com/blog/calendar_tables
-- Marcello Verona 2016 <marcelloverona@gmail.com>
--
--
-- Set italian as language
--
@marciuz
marciuz / harvest-cron-generator.php
Last active May 8, 2017 10:37
Generatore di cron per harvest DKAN dati.gov.it
<?php
$sources = 'http://www.dati.gov.it/admin/harvest-sources-export/harvest-sources-datigovit.csv';
$eccezioni = array(
'regione_toscana',
'dati_trentino',
'dati_lombardia',
'comune_di_firenze_annstat',
);
<?php
function _dkan_harvest_dcatap_cache(HarvestSource $source, $harvest_updatetime) {
// This is needed for remote uri.
$context = stream_context_create(
array(
'http' => array(
'timeout' => 1200,
),
'https' => array(
@marciuz
marciuz / harvest.sh
Created December 22, 2017 10:06
Script per l'harvesting di Dati.gov.it
#!/bin/sh
# File harvest.sh
# Esegue l'harvest del parametro $1, inviato come argomento
# Il parametro è del tipo "dati_trentino", cioè il machine name di DKAN.
#
# Ultima modifica: 08/05/2017 - <marcelloverona@gmail.com>
#
# document root di DKAN
@marciuz
marciuz / mysql-eu-countries
Created October 2, 2019 13:27 — forked from naskobulgaria/mysql-eu-countries
Sql dump of all the European Countries.
/**
* Countries MySQL Tables
* Compiled by Atanas Bozhinov, 2015
*/
CREATE TABLE `eucountries` (
`country_id` int(11) NOT NULL AUTO_INCREMENT,
`code` char(2) NOT NULL COMMENT 'Two-letter country code (ISO 3166-1 alpha-2)',
`name` varchar(64) NOT NULL COMMENT 'English country name',
`full_name` varchar(128) NOT NULL COMMENT 'Full English country name',
@marciuz
marciuz / highchart-european-union.js
Created October 2, 2019 21:31
Preset for Highcharts/Highmaps for the European Union (28 countries)
Highcharts.maps["custom/european-union"] = {
"title": "European Union",
"version": "1.1.2",
"type": "FeatureCollection",
"copyright": "Copyright (c) 2015 Highsoft AS, Based on data from Natural Earth",
"copyrightShort": "Natural Earth",
"copyrightUrl": "http://www.naturalearthdata.com",
"crs": {
"type": "name",
"properties": {