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 | |
# This script replaces `${ENVIRONMENT_VAR}` with the value of `ENVIRONMENT_VAR` environment variable. | |
# Output is compacted with `-c` param of `jq` program. This means that no pretty printed JSON is returned as it is more suitable for machine processing. | |
set -e | |
jq -c 'with_entries( .value |= sub("(?<tmpl_var>\\$\\{.*?\\})"; "\(env[.tmpl_var[2:-1]])") )' "$1" |
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
defp generate_pkce_challenge() do | |
code_verifier = Ecto.UUID.generate() <> Ecto.UUID.generate() | |
code_challenge = | |
:crypto.hash(:sha256, code_verifier) | |
|> Base.url_encode64(padding: false) | |
{code_verifier, code_challenge} | |
end |
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 | |
## Usage: | |
## . ./load_env.sh ; $COMMAND | |
## . ./load_env.sh ; echo ${MINIENTREGA_FECHALIMITE} | |
unamestr=$(uname) | |
if [ "$unamestr" = 'Linux' ]; then | |
export "$(grep -v '^#' .env | xargs -d '\n')" | |
elif [ "$unamestr" = 'FreeBSD' ] || [ "$unamestr" = 'Darwin' ]; then | |
export "$(grep -v '^#' .env | xargs -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
{ | |
"info": { | |
"_postman_id": "69120f2b-dc21-441f-842c-197e6d359a2f", | |
"name": "Magento OAuth", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "MSI", | |
"item": [ |
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
var config = { | |
config: { | |
mixins: { | |
'Magento_Ui/js/lib/validation/validator': { | |
'Lucid_DogeValidation/js/rule-dynamic-message-doge-mixin': true | |
} | |
} | |
} | |
} |
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
// require([ | |
// "jquery", | |
// "mage/url" | |
// ], function ($, url) | |
// | |
// ... | |
$.ajax({ | |
url: url.build('example/url/path'), | |
data: { |
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
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> | |
<extension_attributes for="Magento\Catalog\Api\Data\ProductRenderInterface"> | |
<attribute code="is_customer" type="boolean"/> | |
<attribute code="gift_cards_amount" type="float" /> | |
<attribute code="source_code" type="string" /> | |
<attribute code="tax_grandtotal_details" type="Magento\Tax\Api\Data\GrandTotalDetailsInterface[]" /> | |
<attribute code="ddg_categories" type="string[]"/> | |
<attribute code="test_customer_group_id" type="int"> | |
<resources> | |
<resource ref="permission"/> |
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 | |
use Magento\Framework\Lock\LockManagerInterface; | |
/** @var LockManagerInterface $lock */ | |
if ($lock->isLocked($uniqueIdentifier)) { | |
throw new CouldNotSaveException(__("You can't do this")); | |
} | |
try { |
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 | |
/** @var \Magento\Catalog\Model\ProductFactory $productFactory */ | |
/** @var \Magento\Catalog\Model\Product $product */ | |
$product = $productFactory->create(); | |
$product->getIdBySku($sku); |
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 | |
/** @var \Magento\Framework\Event $event */ | |
$reflectionClass = new \ReflectionClass(get_class($event)); | |
$reflectionProperty = $reflectionClass->getProperty('_data'); | |
$reflectionProperty->setAccessible(true); | |
/** @var \Psr\Log\LoggerInterface $logger */ | |
$logger->debug(implode(', ' , array_keys($reflectionProperty->getValue($event)))); |