Skip to content

Instantly share code, notes, and snippets.

View mapio's full-sized avatar
🎯
Focusing

Massimo Santini mapio

🎯
Focusing
View GitHub Profile
@mapio
mapio / ww.ipynb
Last active December 19, 2023 04:17
A simple monotonic grammar for the repeated word language
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / z3.ipynb
Created December 27, 2021 21:19
Solving Alphametics with z3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / .block
Last active June 25, 2021 09:27
Force-based label placement (d3.v5.js)
license: gpl-3.0
height: 600
@mapio
mapio / bookmarklet.js
Last active June 19, 2021 13:31
A bookmarklet to go from Java 7 APIs documentation to Java 8 APIs documentation
javascript:window.location.assign(window.location.href.replace( /javase\/7\//, 'javase/8/' ));
@mapio
mapio / AdventOfCodeStats.ipynb
Created December 24, 2020 17:24
Advent of Code Statistics
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / graph.png
Last active July 23, 2020 22:22
Playing with my son Federico
graph.png
@mapio
mapio / query_atm_stop
Last active March 24, 2019 09:44
A tool to query ATM stops
#!/bin/bash
if ! type jq >/dev/null 2>&1; then
echo >&2 "$(basename $0): please install https://stedolan.github.io/jq/ first."
exit 1
fi
if [ -z "$1" ]; then
echo >&2 "$(basename $0): plase provide stop number (see http://giromilano.atm.it/)"
exit 1
@mapio
mapio / install.sh
Created March 21, 2019 15:06
Installazione di Prog1.zip
rm -f Prog1.zip
curl -O http://marra.di.unimi.it/prog1/lab/docs/lib/Prog1.zip
unzip Prog1.zip Prog1/IO.h Prog1/Stringhe.h
mv Prog1/IO.h Prog1/Stringhe.h .
rmdir Prog1
rm -f Prog1.zip
@mapio
mapio / nbextensions.sh
Last active March 19, 2019 22:03
Enable hide_code and full_width
pip install jupyter-full-width
jupyter nbextension install --sys-prefix --py full_width
jupyter nbextension enable --sys-prefix --py full_width
pip install hide_code
jupyter nbextension install --sys-prefix --py hide_code
jupyter nbextension enable --sys-prefix --py hide_code
jupyter serverextension enable --sys-prefix --py hide_code
jupyter nbextension list
@mapio
mapio / Setup an USB raw device
Created January 17, 2014 09:31
To boot Virtualbox from a USB pendrive you must first create a virtual disk to access to it and then add it as storage.
#!/bin/bash
if [ -r USB.vmdk ]; then
VBoxManage storageattach "BootFromUSB" --storagectl "SATA" --port 0 --device 0 --medium none
VBoxManage closemedium disk USB.vmdk --delete
fi
sudo chown $USER /dev/disk1*
VBoxManage internalcommands createrawvmdk -filename USB.vmdk -rawdisk /dev/disk1 -partitions 1,2