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
#!/bin/bash | |
# The URL you want to check | |
url="HTTP_MY_AWESOME_URL" | |
status_code=$(curl -o /dev/null --silent --head --write-out '%{http_code}\n' $url) | |
date=`date` | |
# The channel or user you want to notify | |
channel="MY_CHANNEL" | |
# The displayed bot username |
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
<?php | |
/** | |
* @author Nicolas Potier <nicolas.potier@acseo.fr> | |
* | |
* Convert img src="" present in HTML page to <img src="data:image..." | |
* This Script is inspired by https://joekuan.wordpress.com/2015/02/01/converting-html-document-with-img-src-link-to-img-embedded-data-in-php/ | |
* | |
* usage : php convert.php source.html destination.html | |
* | |
*/ |
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
# Install git fame | |
gem install git_fame | |
# Install all vendors with source | |
rm -rf vendor/* | |
composer update --prefer-source | |
# Do the calculations. This might take 30 minutes to complete. | |
rm output.txt | |
find ./vendor -type d -depth 2 ! -path "./vendor/composer" -exec echo {} \; -exec git fame --sort=loc --hide-progressbar --repository={} \; >> output.txt |
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
<?php | |
// This code show how you can easily convert a XML file to an associative array | |
// var_dump( | |
// json_decode( | |
// json_encode( | |
// simplexml_load_string( | |
// file_get_contents( | |
// "https://gist.githubusercontent.com/npotier/5732b6311d2baf95c0e6d5dd7fdeb93f/raw/f6c751f85ad6e646c6f89c81a5ee3a8d452151f5/sample.atom" | |
// ) |
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
brew install ocrmypdf | |
ocrmypdf inputfile.pdf ocrized_outputfile.pdf |
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
This is a search replace instruction to replace deprectated assertAttributeEquals by assertEquals in PHPUnit code : | |
Search : \$this->assertAttributeEquals\(([$\[\]|a-zA-Z1-9 ,]+), '([a-zAZ])([a-zAZ]+)', ([$1-9a-zA-Z\->]+)\); | |
Replace : $this->assertEquals($1, $4->get\U$2$3()); |
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
# https://www.redmine.org/boards/2/topics/62095 | |
# RAILS_ENV=production bin/rails console | |
> p = Project.find("$project_name") | |
> p.issues.where("closed_on < '#{365.days.ago}'").each(&:destroy) | |
# To perform this actions across all projects... | |
> Issue.where("closed_on < '#{365.days.ago}'").each(&:destroy) |
OlderNewer