Skip to content

Instantly share code, notes, and snippets.

View guglielmo's full-sized avatar

Guglielmo Celata guglielmo

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guglielmo
guglielmo / province.json
Last active March 1, 2019 12:05
GeoJson delle province italiane al 1. gennaio 2018. Dal file SHP ISTAT, con semplificazione al 10%.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guglielmo
guglielmo / .block
Last active September 2, 2017 06:23
d3.js v4 - Reusable zoomable treemap
license: gpl-3.0
height: 600
@guglielmo
guglielmo / .block
Last active September 1, 2017 14:17
d3.js v4 - Zoomable treemap
license: gpl-3.0
height: 600
@guglielmo
guglielmo / .block
Last active August 31, 2018 15:42 — forked from JacquesJahnichen/README.md
d3.js v4 - Interactive zoomable treemap
license: gpl-3.0
height: 600
@guglielmo
guglielmo / migrate_repo.sh
Last active May 29, 2017 11:07 — forked from mariozig/migrate_repo.sh
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:guglielmo/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@guglielmo
guglielmo / # graph-tool - 2017-02-28_08-19-11.txt
Created February 28, 2017 08:17
graph-tool (homebrew/science/graph-tool) on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for homebrew/science/graph-tool on macOS 10.11.6
Build date: 2017-02-28 08:19:11
@guglielmo
guglielmo / ansibleSetupPostfixSES.yml
Last active March 3, 2016 09:57 — forked from l0neranger/ansibleSetupPostfixSES.yml
Ansible Playbook - Postfix for SES Delivery
#
# According to AWS Docs - http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html
#
# Rewrites all sender addresses to a single canonical ses verified address.
#
# Expects a vars files at ../vars/PostfixSES-vars.yml with the following variables:
# - ses_host: email-smtp.us-west-x.amazonaws.com
# - ses_port: 587
# - ses_username: ses-smtp-username
# - ses_password: ses-smtp-password
# simple uWSGI script
description "uwsgi emperor"
start on runlevel [2345]
stop on runlevel [06]
exec /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data --daemonize=/var/log/uwsgi/emperor.log
@guglielmo
guglielmo / places.py
Last active December 30, 2015 15:59
Code to reproduce a probable issue within django-rest-framework. A Place may have many acronyms. The reverse fk relationship ('acronyms') is serialized with a nested AcronymSerializer. When issuing PUT to edit the place, the old acronyms not in the json payload anymore, are not removed from the DB. The HTML form shows the error: non_field_errors…
## Models
class Place(models.Model):
name = models.CharField(max_length=255, blank=True)
slug = models.SlugField(max_length=255, null=True, blank=True)
class PlaceAcronym(models.Model):
place = models.ForeignKey('Place', related_name="acronyms")
acronym = models.CharField(_("acronym"), max_length=128,
help_text=_("An acronym for the place, e.g. 'PV'")
)