Skip to content

Instantly share code, notes, and snippets.

View AntoineAugusti's full-sized avatar
🚄
High speed, low carbon

Antoine Augusti AntoineAugusti

🚄
High speed, low carbon
View GitHub Profile
@AntoineAugusti
AntoineAugusti / limitConcurrentGoroutines.go
Last active April 8, 2024 08:33
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {
@AntoineAugusti
AntoineAugusti / ftplib_simple_proxy.py
Created August 8, 2022 12:41 — forked from fmoo/ftplib_simple_proxy.py
An FTP client implementation that supports sending and receiving data via SOCKS proxy using PASV transfers
import ftplib
import socket
import socks # socksipy (https://github.com/mikedougherty/SocksiPy)
class FTP(ftplib.FTP):
def __init__(self, host='', user='', passwd='', acct='',
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
proxyconfig=None):
"""Like ftplib.FTP constructor, but with an added `proxyconfig` kwarg
@AntoineAugusti
AntoineAugusti / gist:4287212
Created December 14, 2012 17:39
Clean virusmails directory
find /var/lib/amavis/virusmails/ -type f -mtime +30 -delete
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps:
- checkout
- restore_cache:
@AntoineAugusti
AntoineAugusti / citymapper_cmi.csv
Last active March 26, 2020 12:57
Citymapper Mobility Index on 2020-03-26
city date percentage
Barcelona 2020-03-02 112
Barcelona 2020-03-03 105
Barcelona 2020-03-04 105
Barcelona 2020-03-05 106
Barcelona 2020-03-06 105
Barcelona 2020-03-07 110
Barcelona 2020-03-08 107
Barcelona 2020-03-09 104
Barcelona 2020-03-10 92
We can't make this file beautiful and searchable because it's too large.
n_amenageur;n_operateur;n_enseigne;id_station;n_station;ad_station;code_insee;Xlongitude;Ylatitude;nbre_pdc;id_pdc;puiss_max;type_prise;acces_recharge;accessibilité;observations;date_maj
Aix-Marseille-Provence;BOUYGUES ENERGIES ET SERVICES;MAMP;FR*M13*P13092*001;SAINT-CHAMAS - Rue Victor Ferrier;Rue Victor Ferrier 0 SAINT-CHAMAS;13092;5.030772;43.549935;0;FR*M13*E13092*001*1;22;EF - T2;payant;24h/24 7j/7;Recharge par badge et avec une application smartphone;2020/07/02
Aix-Marseille-Provence;BOUYGUES ENERGIES ET SERVICES;MAMP;FR*M13*P13115*001;VERNEGUES - Route Du Château Bas;Route Du Château Bas 0 VERNEGUES;13115;5.205005;43.689299;2;FR*M13*E13115*001*1;22;EF - T2;payant;24h/24 7j/7;Recharge par badge et avec une application smartphone;2020/07/02
Aix-Marseille-Provence;BOUYGUES ENERGIES ET SERVICES;MAMP;FR*M13*P13204*004;MARSEILLE-4E - Avenue Des Chartreux;Avenue Des Chartreux 13004 MARSEILLE-4E;13204;5.400736;43.310012;0;FR*M13*E13204*004*2;22;EF - T2;payant;24h/24 7j/7;Recharge par badge et avec une applica
<?php
$PolarChart = new Chart('polar', 'examplepolar');
$PolarChart->set('data', array(20, 55, 16, 30, 42));
$PolarChart->set('legend', array('A', 'B', 'C', 'D', 'E'));
echo $PolarChart->returnFullHTML();
?>
<?php
$BarChart = new Chart('bar', 'examplebar');
$BarChart->set('data', array(array(2, 10, 16, 30, 42), array(42, 30, 16, 10, 2)));
$BarChart->set('legend', array('01/01', '01/02', '01/03', '01/04', '01/05'));
// We don't want to use the x-axis for the legend so we specify the name of each dataset
$BarChart->set('legendData', array('Annie', 'Marc'));
$BarChart->set('displayLegend', true);
echo $BarChart->returnFullHTML();
?>
<?php
$RadarChart = new Chart('radar', 'exampleradar');
$RadarChart->set('data', array(20, 55, 16, 30, 42));
$RadarChart->set('legend', array('A', 'B', 'C', 'D', 'E'));
echo $RadarChart->returnFullHTML();
?>