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
function generateMidjourneyImage($prompt){ | |
$jobIdFile = md5($prompt); | |
if (file_exists('./jobs/' . $jobIdFile)) { | |
$jobId = file_get_contents('./jobs/' . $jobIdFile); | |
die('https://cdn.midjourney.com/' . $jobId . '/0_1.png');//ou 0_2.png ou 0_3.png ou 0_4.png | |
} | |
$client = new GuzzleHttp\Client(); |
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
//créez un fichier mylock avec les droit de l'utilisateur qui execute le cron | |
//lancez la fonction mycron via votre systeme de cron | |
//voila, plus jamais d'overlap de cron | |
function mycron() { | |
$error = false; | |
//on ouvre le fichier du verrou | |
$fp = fopen("./mylock", "w+"); | |
if (flock($fp, LOCK_EX | LOCK_NB)) { // acquière un verrou exclusif | |
//toute la logique metier du cron qui peut durer |
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
awk '{if($14 ~ /Googlebot/) {print $7}}' apache.log | sort | uniq -c | sort -n | tail -40 | sed 's/^[ \t]*//;s/[ \t]*$//' > top40google.csv | |
more apache.log | grep Googlebot | awk {'split($4, a, ":"); split(a[1], a, "["); print a[2]'} | sort | uniq -c | sed 's/^[ \t]*//;s/[ \t]*$//' > google-visits-per_day.csv | |
more apache.log | grep Googlebot | awk {'print $7'} | sort | uniq -c | wc -l |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
$('.stream-container').bind("DOMNodeInserted",function(){$('.js-promoted-badge').closest('.js-stream-item').each(function(index) { $(this).hide() });}); | |
javascript:(function(){$('.stream-container').bind("DOMNodeInserted",function(){$('.js-promoted-badge').closest('.js-stream-item').each(function(index) { $(this).hide() });}); })(); |
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
$('.stream-item-header').each(function(index) { console.log($(this).find('.fullname')[0].innerHTML+';'+$(this).find('.username')[0].innerHTML) }); |
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
sed -e 's/î/î/g' -i monfichier | |
sed -e 's/î/î/g' -i monfichier | |
sed -e 's/û/û/g' -i monfichier | |
sed -e 's/é/é/g' -i monfichier | |
sed -e 's/û/û/g' -i monfichier | |
sed -e 's/é/é/g' -i monfichier | |
sed -e 's/ç/ç/g' -i monfichier | |
sed -e 's/ç/ç/g' -i monfichier | |
sed -e 's/Ã /à/g' -i monfichier | |
sed -e 's/è/è/g' -i monfichier |