Skip to content

Instantly share code, notes, and snippets.


Massimo Santini mapio

Block or report user

Report or block mapio

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
mapio / Vagrantfile
Last active Aug 29, 2015
La configurazione di Vagrant per la macchina virtuale codebox4im
View Vagrantfile
Vagrant.configure("2") do |config|
if ARGV[0] == 'up' || ARGV[0] == 'provision' || ARGV[0] == 'reload'
if File.exists?( '' )
$provisioning_script = '' ).read
$stderr.puts( "Using '' for provisioning...\n" )
require 'net/http'
$provisioning_script = Net::HTTP.get(URI(''))
$stderr.puts( "Downloaded gist #ef23edceb8a5709b87d0 for provisioning...\n" )
mapio /
Last active Aug 29, 2015
How to install gunicorn + gevent on OS X 10.10 Yosemite

Given that I've spent a few hours to get it right, here is how I did it.

First install the required dependencies using Homebrew, by this I mean at least

brew install python libevent

Then upgrade setuptools with

curl -o - | python
mapio /
Last active Aug 29, 2015
Come tenere occupato un nano saccente…
# -*- coding: utf-8 -*-
import subprocess
from random import randint, choice
VOCI = "Alice", "Federica", "Luca", "Paola"
COMPIMENTI = "geniaccio", "sei un figo", "super", "che gallo"
OFFESE = "coglionazzo", "minchione", "cacchio dici"
OP = ( lambda a, b: a + b, "più"), ( lambda a, b: a - b, "meno" )
mapio / collapse
Created Jan 15, 2015
A trick to collapse Mercurial revisions in steps
View collapse
dbg() {
echo WORK
hg -R work log --template '{node|short} {desc}\n'
hg -R public log --template '{node|short} {desc}\n'
echo CLEAN
hg -R clean log --template '{node|short} {desc}\n'
mapio /
Last active Aug 29, 2015
How to "archive" an initial segment of a Mercurial repository history.
# let's assume that we have an "original" repo and that we want to
# create a new "archvied" repo with a first release corresponding to what
# happened in the original repo in revisions O:ARCHIVE, plus all the
# releases (ARCHIVE+1):tip in the original repo.
# first remove the cruft from the previous run
rm -rf original archived
# now create the "original" repository that will contain a
mapio / digitalocean.txt
Created Jan 18, 2015
Linode vs. Digitalocean
View digitalocean.txt
BYTE UNIX Benchmarks (Version 5.1.3)
System: digitalocean: GNU/Linux
OS: GNU/Linux -- 3.8.0-38-generic -- #56~precise1-Ubuntu SMP Thu Mar 13 16:22:48 UTC 2014
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: QEMU Virtual CPU version 1.0 (4800.0 bogomips)
19:06:58 up 4 days, 15:52, 1 user, load average: 0.62, 0.58, 0.31; runlevel 2
mapio /
Last active Aug 29, 2015
How to install a kind of desktop client for Instagram on OSX

You just need two steps:

Invoking `instagram' from the shell will then do the trick.

mapio / bookmarklet.js
Last active Aug 29, 2015
A bookmarklet to go from Java 7 APIs documentation to Java 8 APIs documentation
View bookmarklet.js
javascript:window.location.assign(window.location.href.replace( /javase\/7\//, 'javase/8/' ));
mapio /
Created Apr 17, 2015
A small script to serve a local directory via HTTP
# see
trap 'kill -TERM $PID' TERM INT
python -m SimpleHTTPServer & PID=$!
python -m webbrowser -t ""
wait $PID
mapio /
Created May 11, 2015
A flask-admin bug report concerning FileUploadField
from functools import partial
from os import remove
from os.path import join
from flask import Flask
from flask.ext.admin import Admin, form
from flask.ext.admin.contrib.sqla import ModelView
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.event import listens_for
You can’t perform that action at this time.