This file contains 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
fetch("https://www.nosdeputes.fr/deputes/json").then(data => data.json()).then(data => { | |
DEPUTES = {} | |
data.deputes.forEach(dep => { | |
dep = dep.depute | |
DEPUTES[dep.nom_de_famille.toUpperCase()] = dep.groupe_sigle | |
}) | |
function process() { | |
document.querySelectorAll("#amdtAuteur").forEach(x => { | |
if (!x.hasAttribute("processed")) { | |
var nom = x.innerText.replace("de", "").replace(" et plusieurs de ses collègues", "").replace("M.", "").replace("Mme", "") |
This file contains 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
<!DOCTYPE html> | |
<body> | |
<p style="font-family: sans-serif;padding-left: 27px;margin: 0;"> | |
darkest green = 5+ contributions | lightest green = at least one contribution | |
</p> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/moment@2.27.0/moment.min.js"></script> | |
<script> | |
var width = 960, |
This file contains 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
from pprint import pprint | |
def convert(date): | |
day, hour = date.split(' à ') | |
hour = int(hour.replace('h', '')) | |
return day + '_' + str(hour).rjust(2, '0') | |
def merge(start, end, other_start, other_end): | |
if other_start < start and other_end < start: | |
return None |
This file contains 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
Gilbert Collard 226K | |
Nadine Morano 218K | |
Raphaël Glucksmann 197.8K | |
Jordan Bardella 75.9K | |
Yannick Jadot 61.5K | |
Nicolas Bay 60.9K | |
Thierry Mariani 58K | |
François-Xavier Bellamy 52.6K | |
Manon Aubry 50.4K | |
Pascal Canfin 46.1K |
This file contains 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 requests | |
from bs4 import BeautifulSoup | |
with open('urls','w') as f: | |
while True: | |
r = requests.get("https://login.corp.google.com/") | |
soup = BeautifulSoup(r.text) | |
src = soup.find("img","login-image")['src'] | |
print(src) | |
f.write(src+"\n") |
This file contains 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
TODO = """ | |
- [x] Article 1 | |
- [x] Article 2 | |
- [x] Article 3 | |
- [x] Article 4 | |
- [x] Article 5 | |
- [x] Article 6 | |
- [x] Article 7 | |
- [x] Article 8 | |
- [x] Article 9 |
This file contains 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
""" | |
FST (Full Steiner tree) generator Version 3 parser | |
Documentation: http://geosteiner.com/geosteiner-5.1-manual.pdf (page 186) | |
How to use: "./rand_points 10 | ./efst | ./bb -f | python3 fst2json.py" | |
To note, an alternate method is to grep for the " % @C XXX YYY" output from `bb`, | |
to get the Steiner points. (page 158 of the manual) | |
""" |
This file contains 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 os, glob | |
import diff_match_patch as dmp_module | |
dmp = dmp_module.diff_match_patch() | |
stashed = False | |
for file in glob.glob('textes_des_reglements/**/*.md'): | |
# (FR) commit à partir duquel les corrections ont été manuelles |
This file contains 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 requests, csv | |
# optional: makes requests-cache make it easy to cache your results | |
# import requests_cache | |
# requests_cache.install_cache('reddit_cache') | |
# where we store all the rows | |
DATA = [] | |
def get(url, args={}): |
This file contains 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 mwpersistence | |
import deltas | |
import mwreverts | |
import sys | |
from pathlib import Path | |
import git |