Skip to content

Instantly share code, notes, and snippets.

View julienarcin's full-sized avatar
:octocat:
May the forks be with you

Julien Arcin julienarcin

:octocat:
May the forks be with you
View GitHub Profile
@julienarcin
julienarcin / script-scrap-accountant-directory.php
Last active August 10, 2022 02:56
Scrapping annuaire expert comptable
<?php
/**
*
* Script pour scrapper un annuaire d'expert comptable
* Ref ici: https://www.growthhacking.fr/t/scraper-un-annuaire-expert-comptable/23995
*
* Julien Arcin
*
*/
async function get_gravatar(email, size) {
// MD5 (Message-Digest Algorithm) by WebToolkit
var MD5=function(s){function L(k,d){return(k<<d)|(k>>>(32-d))}function K(G,k){var I,d,F,H,x;F=(G&2147483648);H=(k&2147483648);I=(G&1073741824);d=(k&1073741824);x=(G&1073741823)+(k&1073741823);if(I&d){return(x^2147483648^F^H)}if(I|d){if(x&1073741824){return(x^3221225472^F^H)}else{return(x^1073741824^F^H)}}else{return(x^F^H)}}function r(d,F,k){return(d&F)|((~d)&k)}function q(d,F,k){return(d&k)|(F&(~k))}function p(d,F,k){return(d^F^k)}function n(d,F,k){return(F^(d|(~k)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(G){var Z;var F=G.length;var x=F+8;var k=(x-(x%64))/64;var I=(k+1)*16;var aa=Array(I-1);var d=0;var H=0;while(H<F){Z=(H-(H%4))/4;d=(H%4)*8;aa[Z]=(aa[Z]|(G
@julienarcin
julienarcin / stream-mysql-import.sh
Last active October 5, 2020 13:37
Stream MySQL import
# This command allow to import a dump into database which is being simultaneously downloaded (with filezilla, etc.) or created by another program
# Without progressbar
tail -f -n +1 database.sql | mysql database
# With pv/progressbar (replace 1234 with the size of the dump)
tail -f -n +1 database.sql | pv -s 1234 | mysql database
# With pv/progressbar and gunzip
tail -f -n +1 database.sql.gz | pv -s 1234 | gunzip | mysql database