Skip to content

Instantly share code, notes, and snippets.

Francesco Frassinelli frafra

Block or report user

Report or block frafra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@frafra
frafra / gpap-notes2geojson.sql
Last active Apr 6, 2018
From GeoPaparazzi notes to OpenStreetMap through GeoJSON
View gpap-notes2geojson.sql
/*
Description:
This query allows to convert notes from GeoPaparazzi into a GeoJSON
file that can be imported into JOSM.
Usage:
$ sqlite3 geopaparazzi.gpap < gpap-notes2geojson.sql > geopaparazzi.geojson
Made by:
Francesco Frassinelli - https://frafra.eu
*/
with osm as (
@frafra
frafra / schiena-dritta.py
Last active Jan 17, 2018
Simple adaptive notification system
View schiena-dritta.py
#!/usr/bin/env python3
#
# License: GPLv3
# Author: Francesco Frassinelli (fraph24@gmail.com)
# Copyright: Francesco Frassinelli 2018
import gi
gi.require_version('Notify', '0.7')
from gi.repository import GLib, Notify
@frafra
frafra / inkscape-devel.md
Created Dec 8, 2017
inkscape-devel on Fedora 27
View inkscape-devel.md

How to install Inkscape devel on Fedora 27

Installation

# dnf build-dep inkscape
# dnf install gcc-c++ libsoup-devel gtkmm30-devel
$ git clone -b master https://git.launchpad.net/inkscape --depth 1
$ mkdir -p inkscape/build/conf
$ cd inkscape
@frafra
frafra / poliadventures-17december.md
Last active Nov 16, 2018
Quests - December 2017 #PoliMappersAdventures
View poliadventures-17december.md

Quests - December 2017 #PoliMappersAdventures

  1. Learn something you didn't know about OpenStreetMap https://learnosm.org/
  2. Install StreetComplete (for Android) or Go Maps (for iOS) https://github.com/westnordost/StreetComplete#download or https://itunes.apple.com/app/id592990211
  3. Map a bench https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbench
  4. Find a bench and add the backrest tag https://wiki.openstreetmap.org/wiki/Key:backrest
  5. Map a picnic table https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dpicnic_table
  6. Find a bench or a picnic table and add the material tag https://wiki.openstreetmap.org/wiki/Key:material
  7. Map a trash bin (unsorted waste only) https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dwaste_basket
  8. Map a container for recycling of used goods https://wiki.openstreetmap.org/wiki/Tag:amenity%3Drecycling
@frafra
frafra / osh2sqlite.py
Last active Oct 8, 2018
OSM node history to SQLite
View osh2sqlite.py
#!/usr/bin/env python3
#
# OSM node history to SQLite
import osmium
import sqlite3
import sys
SCHEMA_OBJECT = """
@frafra
frafra / osm-node-history.py
Last active Feb 23, 2018
OSM node history (just a test)
View osm-node-history.py
#!/usr/bin/env python3
#
# OSM node history to SQLite
import osmium
import sqlite3
import sys
SCHEMA_NODES = """
CREATE TABLE nodes
View posta2csv.py
#!/usr/bin/env python3
#
# Convertitore delle mail del Raspberry Pi di Ugone
# Scritto da Frafra (2017)
import collections
import csv
import glob
messages = glob.glob('messaggi/*.txt')
@frafra
frafra / seren.sh
Created Sep 17, 2017
Flatpak for Seren
View seren.sh
#!/bin/bash -ex
# Latest build ready to install:
# $ wget https://about.frafra.eu/private/seren-0.0.22dev20161009.flatpak
# $ flatpak install seren-0.0.22dev20161009.flatpak
# $ flatpak run org.seren.Seren
# This flatpak is build upon freedesktop.Sdk//1.6
# $ flatpak remote-add --from gnome https://sdk.gnome.org/gnome.flatpakrepo
# $ flatpak install gnome org.freedesktop.Sdk//1.6
@frafra
frafra / pylife.py
Created Aug 29, 2017
Bruteforce Conway's "Game of Life"
View pylife.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Francesco Frassinelli <fraph24@gmail.com>
#
# pylife is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@frafra
frafra / sensors.plot
Last active Jun 25, 2017
gnuplot example
View sensors.plot
# Remove quotes from the input file if needed:
# $ sed -i "s/'//g" 20170623.csv
# How to use this script:
# $ gnuplot -e "filename='20170623.csv'" sensors.plot
set terminal pngcairo size 640,480 enhanced font 'Verdana,10'
set output system('basename '.filename.' .csv').'.png'
set multiplot layout 2,1 rowsfirst title filename font ",14"
You can’t perform that action at this time.