Skip to content

Instantly share code, notes, and snippets.

@gapato
gapato / d.json
Last active Nov 28, 2021
Multilingual mathematics dictionary
View d.json
[
{ "en" : "-",
"fr" : "-",
"de" : "-",
"it" : "-",
"terms" : [
{ "key" : "term",
"fr" : { "txt" : "terme (m), (pré)facteur (m), coéffiecient (m)" },
"en" : { "txt" : "term, (pre)factor, coefficient" },
"de" : { "txt" : "Glied (m), (Vor)Faktor (m), Koeffizient (m)" },
View pdfjoin
#!/bin/zsh
OUT=${1:r}.joined.${1:e}
cmd="qpdf --empty --pages"
for i in $*; do;
cmd="$cmd '$i'"
done
@gapato
gapato / dic.csv
Last active Jun 1, 2018
International bicycle dictionary
View dic.csv
FR EN IT DE
1 vélo (m)/bicyclette (f) bike/bicycle bicicletta (f) Fahrrad (nt)
2 cadre (m) frame telaio (m) Rahmen (m)
3 fourche(l) fork forcella (f) Gabel (f)
4 guidon (m) handlebar manubrio (m) Lenker (m)
5 roue (f) wheel ruota (f) Laufrad (nt)
6 jante (f) rim cerchio (m) Felge (f)
7 moyeu (m) hub mozzo (m) Nabe (f)
8 rayon (m) spoke raggio (m) Speiche (f)
9 pneu (m) tire (US)/tyre (UK) copertone (m) Reifen (m)
View wien.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gapato
gapato / adjacence.py
Last active Aug 29, 2015
Plot collaboration graph from list of papers
View adjacence.py
#!/usr/bin/python
from __future__ import division
import sys
import csv
import numpy # MATLAB-like numerical library
import networkx as nx # To plot the graph
import matplotlib.pyplot as plt
from matplotlib.patches import FancyArrowPatch, Circle
@gapato
gapato / elevator.js
Created Feb 8, 2015
ElevatorSaga try
View elevator.js
{
init: function(elevators, floors) {
document.elevators = elevators;
document.way = function() {
c = this.currentFloor();
if (this.destinationQueue.length === 0) {
return null;
}
@gapato
gapato / scomp.py
Last active Aug 29, 2015
Compare series
View scomp.py
from numpy import genfromtxt, average, median, std, percentile
from sys import argv, exit
if len(argv) < 3:
print 'Usage: {0} <series1.txt> <series2.txt> [map lambda]'.format(argv[0])
exit(1)
lam = None
if len(argv) == 4:
lam = eval(argv[3])
View gist:60dc9498d6ce53d6d19b
#!/usr/bin/env python
# coding: utf-8
from bs4 import BeautifulSoup
import urllib
import urllib2
import re
import sys
ws_re = re.compile('(\d+) km/h')
@gapato
gapato / lbc2num.sh
Created Jul 18, 2014
Grab phone number from leboncoin.fr ad url or id
View lbc2num.sh
#!/bin/sh
PHONE_API_URL=http://www2.leboncoin.fr/ajapi/get/phone?list_id=
quit () {
echo "No phone number for this ID"
exit
}
while (($#)); do
@gapato
gapato / pgfplot boilerplate
Created Mar 4, 2014
pgfplots example/boilerplate
View pgfplot boilerplate
\documentclass[draft]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{pgfplotstable}
\begin{document}
%% Linear plot