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
#!/bin/sh | |
sudo snap list | grep -IoE '^([a-z0-9\-]+)' | xargs -I{} sudo snap refresh {} --edge |
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
#!/bin/bash | |
set -eux | |
diff -u <(docker image history yourrepo/yourimage1:yourtag) <(docker image history yourrepo/yourimage2:yourtag) |
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
// Remove collection name from the breadcrumb | |
pm.execution.location.splice(0, 1); | |
// Remove the last element as it is the request and we don't need it | |
pm.execution.location.pop(); | |
let currentLocation = pm.execution.location.map(item => item.replace(/^((\d+\.\d*)(\s+))/, '').toLowerCase().split(' ').join('_')).join('_') || pm.variables.replaceIn('{{$uuid}}'); | |
console.log('computed current location', currentLocation); | |
// set collection level current location to use it in all request and responses in this collection and it also mean it is self-contained |
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
let currentLocation = pm.collectionVariables.get('computed_current_location'); | |
pm.test(`Successful 2xx request for ${currentLocation}`, () => { | |
pm.expect(pm.response.code).to.be.oneOf([200, 201, 202, 203, 204, 205, 206, 207, 208, 226]); | |
}); | |
let method = pm.request.method; | |
if (['POST', 'PATCH', 'PUT'].includes(method)) { | |
pm.test("Content-Type is present for ${currentLocation}", () => { |
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
<?php | |
// Solution ucfirst bug when string is already in ALLCAPS | |
$result = (isset($givenString) && !empty(trim($givenString)) ? mb_ucfirst(mb_strtolower($givenString)) : ''); |
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
(<<<<<<< ([A-Za-z\s]+)\n)([\p{Print}\p{Space}\p{ASCII}\p{L}]+)\n(=======)\n([\p{Print}\p{Space}\p{ASCII}\p{L}]+)(>>>>>>> ([A-Za-z\s]+)) |
Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager()->registerAndUseScript('plausible-io', 'https://plausible.io/js/script.js', [], ['defer' => true, 'data-domain' => \Joomla\CMS\Uri\Uri::getInstance()->getHost()], []);
Scratched my own itch. Thought it might be useful to you too.
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
<?php | |
/** Redirection vers article personnalisé */ | |
if ($this->error->getCode() == 404) { | |
header(sprintf('Location: %s', \Joomla\CMS\Router\Route::_('index.php?option=com_content&view=article&id=64', false, \Joomla\CMS\Router\Route::TLS_FORCE, true))); | |
exit(0); | |
} |
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
<?php | |
declare(strict_types=1); | |
/* | |
YOUR ATTENTION PLEASE. THE NEW PLACE FOR THIS CODE IS : https://github.com/alexandreelise/j4x-api-examples | |
*/ | |
/** |
NewerOlder