Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Massimo Santini mapio

🎯
Focusing
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
mapio / .block
Last active Jun 5, 2019
Force-based label placement (d3.v5.js)
View .block
license: gpl-3.0
height: 600
@mapio
mapio / query_atm_stop
Last active Mar 24, 2019
A tool to query ATM stops
View query_atm_stop
#!/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 Mar 21, 2019
Installazione di Prog1.zip
View install.sh
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 Mar 19, 2019
Enable hide_code and full_width
View nbextensions.sh
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 / ww.ipynb
Last active Feb 20, 2019
A simple monotonic grammar for the repeated word language
View ww.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / Setup an USB raw device
Created Jan 17, 2014
To boot Virtualbox from a USB pendrive you must first create a virtual disk to access to it and then add it as storage.
View Setup an USB raw device
#!/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
@mapio
mapio / Printing trees.ipynb
Last active Jan 9, 2019
Some recursive code to print trees
View Printing trees.ipynb
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 Sep 17, 2018
Playing with my son Federico
@mapio
mapio / (Sort of) busy wait workaround for SpeechSynthesisUtterance.onend bug.markdown
Created Nov 29, 2015
(Sort of) busy wait workaround for SpeechSynthesisUtterance.onend bug
View (Sort of) busy wait workaround for SpeechSynthesisUtterance.onend bug.markdown
@mapio
mapio / ArgMax.java
Created Feb 23, 2015
An implementation of an argmax collector using the Java 8 stream APIs
View ArgMax.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collector;
class ArgMaxCollector<T> {
private T max = null;
private ArrayList<T> argMax = new ArrayList<T>();
You can’t perform that action at this time.