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
# 1. Install ruby using brew | |
# 3. Run in terminal: gem install algoliasearch | |
# 4. Run this script in terminal: ruby script.rb | |
require 'json' | |
require 'algoliasearch' | |
Algolia.init(application_id: '<insert id here>', api_key: '<insert admin key here>') | |
index = Algolia::Index.new('< name of your index >') |
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
<?xml version="1.0"?> | |
<!-- | |
/** | |
* Copyright Magento, Inc. All rights reserved. | |
* See COPYING.txt for license details. | |
*/ | |
--> | |
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd"> | |
<policies> | |
<policy id="default-src"> |
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 | |
echo Enter domain: | |
read domain | |
openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ |
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 | |
# Check if command was ran as root. | |
if [[ $(id -u) -eq 0 ]]; then | |
echo "The command \"sphp\" should not be executed as root or via sudo directly." | |
echo "When a service requires root access, you will be prompted for a password as needed." | |
exit 1 | |
fi | |
# Usage |
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 | |
\Magento\Framework\Filesystem\Io\File $file | |
\Magento\Framework\App\Filesystem\DirectoryList $directoryList | |
/** | |
* @param array $files | |
* @throws \Magento\Framework\Exception\FileSystemException | |
*/ | |
public function archiveFile(array $files) |
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 | |
namespace Vendor\Distributors\Jobs; | |
use DateTime; | |
use DateTimeZone; | |
use Vendor\Distributors\Helpers\DistributorData; | |
use Exception; | |
use GuzzleHttp\Exception\GuzzleException; | |
use Magento\Framework\Api\SearchCriteriaBuilder; |
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
<?xml version="1.0"?> | |
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<body> | |
... | |
<referenceBlock name="product.info.social"> | |
<block class="Magento\Catalog\Block\Product\View" name="product.info.brand" as="brand" template="Magento_Catalog::product/view/brand.phtml"></block> | |
</referenceBlock> | |
... | |
</body> | |
</page> |
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
/** | |
* Copyright © Magento, Inc. All rights reserved. | |
* See COPYING.txt for license details. | |
*/ | |
// For performance use one level down: 'name/{,*/}*.js' | |
// If you want to recursively match all subfolders, use: 'name/**/*.js' | |
module.exports = function (grunt) { | |
'use strict'; |
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
<script src="http://cdn.jsdelivr.net/g/filesaver.js"></script> | |
<script> | |
function SaveAsFile(t,f,m) { | |
try { | |
var b = new Blob([t],{type:m}); | |
saveAs(b, f); | |
} catch (e) { | |
window.open("data:"+m+"," + encodeURIComponent(t), '_blank',''); | |
} | |
} |
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
public function afterGetValue(\Magento\ConfigurableProduct\Pricing\Price\FinalPrice $subject, $result) | |
{ | |
/** | |
* @todo Add check on whether preselect is enabled | |
**/ | |
$defaultProductId = $this->defaults->getDefaultProductId($subject->getProduct()); | |
if (!$defaultProductId) { | |
$defaultProductId = (int) $this->_request->getParam('id'); | |
} | |
if ($defaultProductId) { |
NewerOlder