git checkout feature
git rebase dev
git push --force # car l'historique a changé, OK si personne ne travail sur _feature_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Script pour générer des INSERT SQL à partir d'un flux GBFS JSON. | |
| Usage : | |
| python3 gbfs.py <url> <system_id> <id_meca> <id_electrical> | |
| Exemple : | |
| python3 gbfs.py https://media.ilevia.fr/opendata/station_status.json v_lille bike NULL | psql service=work | |
| python3 gbfs.py https://api.cyclocity.fr/contracts/amiens/gbfs/v2/station_status.json velam mechanical electrical | psql service=work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const dataGroupBy = (data:[], group_fields:string[], metric_field:string, method:string) => { | |
| const agg_function:(arr:[], field:string) => number = ((arr, field) => { | |
| switch(method){ | |
| case 'sum': | |
| return _.sumBy(arr, field) | |
| case 'min': | |
| return _.minBy(arr, field)[field] | |
| case 'max': | |
| return _.maxBy(arr, field)[field] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import threading | |
| import sys | |
| import logging | |
| import locale | |
| import re | |
| from datetime import datetime | |
| locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| class Door: | |
| def __init__(self, name): | |
| self.is_winner = False | |
| self.is_open = False | |
| self.name = name | |
| self.is_chosen = False | |
| def __repr__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io | |
| from sys import stdout, stdin, stderr | |
| import clevercsv | |
| import chardet | |
| """ | |
| Script permettant de lire un csv sur l'entrée standard, et de retourner sur la sortie un CSV RFC-4180 en UTF-8. | |
| Le script detecte l'encoding (chardet) et le dialect (clevercsv). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \copy mytable from 'fichier.json' WITH csv quote e'\x01' delimiter e'\x02' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select table_name, column_name, col_description((table_schema||'.'||table_name)::text::regclass, ordinal_position) | |
| from information_schema.COLUMNS | |
| where table_schema = 'sinoe' and table_name LIKE 'ind_reg%'; | |
| -- https://stackoverflow.com/a/44493548/10995624 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE VIEW pgmetadata.v_dataset_as_inspire AS | |
| WITH "MaintenanceFrequencyCode"(code, inspire_code) AS ( | |
| VALUES | |
| ('NEC','asNeeded'), | |
| ('YEA','annually'), | |
| ('MON','monthly'), | |
| ('WEE', 'weekly'), | |
| ('DAY','daily'), | |
| ('TRI', 'quarterly'), | |
| ('BIA', 'biannually'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Indication de la puissance "instantanné" a partir de l'index EDF (en Wh). | |
| Il s'agit en fait l'évolution de l'index sur la plus petite unité de temps possible (dépend de la fréquence de remonté | |
| de l'info, en général 1 min ou 30 sec) | |
| divisée par l'interval entre les deux mesures --> puissance en W. | |
| Sur des intervals de temps plus longz, selon correspond à la puissance moyenne utilisée. | |
| */ | |
| SELECT | |
| *, |
NewerOlder