from difflib import SequenceMatcher
text1 = "Mais pourquoi la petite sirène est-elle aussi super, ce n'est pas comme les méchants poissons"
text2 = "Il était une fois une petite sirène super méchante qui mangeait des poissons"
matcher = SequenceMatcher(None, text1, text2)
blocks = matcher.get_matching_blocks()
for pos1, pos2, size in blocks:
print(size, pos1, pos2, text1[pos1:pos1+size])
>>> 1 1 5 a
>>> 3 2 15 is
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
let scroll = 0; | |
function handleNextMedia() { | |
const el = document.querySelector(".Media"); | |
if (!el) { | |
document.querySelector(".Profile.custom-scroll").scrollTo(0, scroll + 1800); | |
return setTimeout(() => handleNextMedia(), 5000); | |
} | |
$(el).click(); | |
setTimeout(() => { | |
$(".MediaViewerActions .icon-download").click(); |
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
convert -delay 5 $1_snapshot_*.png $1.gif |
This file has been truncated, but you can view the full file.
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
<?xml version='1.0' encoding='UTF-8'?> | |
<gexf xmlns="http://gexf.net/1.3" version="1.3" xmlns:viz="http://gexf.net/1.3/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://gexf.net/1.3 http://gexf.net/1.3/gexf.xsd"> | |
<meta lastmodifieddate="2022-07-08"> | |
<creator>Gephi 0.9.3</creator> | |
<description></description> | |
</meta> | |
<graph defaultedgetype="undirected" mode="static"> | |
<attributes class="node" mode="static"> | |
<attribute id="attr_type" title="attr_type" type="string"/> | |
<attribute id="global_occurrences" title="global_occurrences" type="integer"/> |
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
#!/usr/bin/env python | |
import sys | |
from socket import socket | |
ports = range(int(sys.argv[1]), int(sys.argv[2])) | |
s = socket() | |
for port in ports: | |
try: | |
print "TEST %s..." % port |
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
alarm() { | |
perl -e ' | |
eval { | |
$SIG{ALRM} = sub { die }; | |
alarm shift; | |
system(@ARGV); | |
}; | |
if ($@) { exit 1 } | |
' "$@"; | |
} |
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
#!/usr/bin/env python | |
import os | |
import sys | |
import csv | |
import json | |
import requests | |
metadata = { | |
"id": None, "desc": None, "createTime": None, "originalItem": 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
import sys, json | |
from InstagramAPI import InstagramAPI | |
from time import sleep | |
from pprint import pprint | |
#import pandas as pd | |
#import requests, urllib, bs4, ssl, json, sys, re | |
def connect_api(user, password): | |
api = InstagramAPI(user, password) | |
retries = 12 |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os, sys, csv, json | |
from datetime import datetime | |
from pyquery import PyQuery as pq | |
# TODO | |
# - Remove duplicates | |
# - Filtering |
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
# On lit les headers dans la première ligne des csv | |
headers=$(cat */*/*.csv | head -1) | |
# On réécrit les headers avec nos champs en plus dans le fichier final | |
echo "Lycee,classe,eleve,$headers" > all.csv | |
# On itère sur l'arborescence des dossiers et stocker les noms dans des variables | |
ls | grep Lycée | while read lycee; do | |
ls "$lycee" | while read classe; do | |
ls "$lycee/$classe" | grep ".csv$" | sed 's/\.csv$//' | while read eleve; do |
NewerOlder