Skip to content

Instantly share code, notes, and snippets.

#/bin/bash
for file in *.csv
do
cat $file | perl -pe 's/(\d+),(\d+,?)/$1.$2 /g' | perl -pe 's/, /\t/' > ${file:0:4}.tsv
done
@AvverbioPronome
AvverbioPronome / gist:6757623
Last active December 24, 2015 06:29
piperone.py
# Cosa dovrebbe fare questo script.
#
# Questo script dovrebbe prendere in input qualcosa di simile
# al file che contiene tutti i datapoint, con i riferimenti
# al numero della foto, e per ognuno di questi dovrebbe prendere
# l'appropriato tsv, quindi calcolare il raggio della circonferenza
# che ci interessa, e sputare il tutto fuori su stdout, in modo
# che gnuplot possa plottare.
import scipy as sp
#! /usr/bin/env python3
from string import ascii_uppercase
alphabeth = ascii_uppercase
def caesar(string, key):
"""Given a `string` and a `key`, return-s a string in which every
character is substituted with the one `key` positions forward in
the `alphabeth`.
@AvverbioPronome
AvverbioPronome / downloader.py
Last active March 13, 2019 12:27
download a whole season from raiplay.it
#!/usr/bin/env python3
# USAGE:
# $ ./downloader.py http://www.raiplay.it/programmi/*/puntate | youtube-dl -a -
import sys
import requests
import bs4
from urllib.parse import urljoin
# TODO: (better, selective) Exception handling
@AvverbioPronome
AvverbioPronome / 00_Pendolo.ipynb
Last active October 26, 2018 09:23
Pendolo.ipynb and related data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AvverbioPronome
AvverbioPronome / keep_wifi_up.sh
Last active June 1, 2020 14:27
Very aggressive script to handle stuck network interfaces on a raspberry pi
#!/bin/sh
ROUTER_IP=192.168.1.1
COUNTER=/tmp/networkisdown
MAXCALLS_REBOOT=6
WIFI_INTERFACES="wlan0 wlan1"
<?php
class ff_nonprintables extends Plugin {
private $host;
function about(){
return array(0.1, "nonprintables", "peppec", false);
// inspired by https://github.com/fastcat/tt-rss-ff-xmllint
}
function api_version(){
@AvverbioPronome
AvverbioPronome / .gitignore
Last active April 18, 2020 10:07
keeptalking
.ipynb_checkpoints/
@AvverbioPronome
AvverbioPronome / force-fb-light.user.js
Created October 10, 2020 08:23
force facebook 2020 interface to use the light theme
// ==UserScript==
// @name Force Facebook to use the light theme.
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.facebook.com/*
// @grant none
// @run-at document-idle
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js