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
// ==UserScript== | |
// @name AutoSet to PP Users in JIRA tickets | |
// @namespace Pinpoint Designs | |
// @version 0.1 | |
// @description When a user hits "Add a comment ..." in JIRA, then it will auto assign security to "PP Users" | |
// @author Douglas Radburn @ Pinpoint Designs | |
// @match https://pinpointdesigns.atlassian.net/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net | |
// @require https://code.jquery.com/jquery-1.8.3.min.js | |
// @grant none |
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
php73 -dmemory_limit=-1 /usr/local/bin/composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition . | |
mysql -uroot -proot -e "create database TESTINGDB" | |
php73 -dmemory_limit=-1 bin/magento setup:install --base-url="http://TESTING.local/" \ | |
--db-host="localhost" --db-name="TESTINGDB" --db-user="root" --db-password="root" \ | |
--admin-firstname="admin" --admin-lastname="admin" --admin-email="admin@admin.com" --admin-user="admin" --admin-password="admin123" \ | |
--language="en_US" --currency="GBP" --timezone="Europe/London" --use-rewrites="1" --backend-frontname="admin" |
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 | |
$pathLen = 0; | |
$foundCompare = $notExistingForCompare = $nonMagentoForCompare = []; | |
$files = ['phtml', 'xml']; | |
function compareFiles($a, $b) | |
{ | |
// Check if content is different | |
$ah = fopen($a, 'rb'); |
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
# Manually secure port 6379 | |
sudo iptables -A INPUT -p tcp --dport 6379 -s xxx.xxx.xxx.xxx -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 6379 -j DROP | |
sudo iptables -L | |
# Save current firewall config | |
sudo iptables-save > /etc/iptables.conf | |
# Load iptables.conf on startup | |
sudo nano /etc/rc.local |
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 | |
namespace Pinpoint\Handle\Observer; | |
class AddLayoutHandle implements \Magento\Framework\Event\ObserverInterface | |
{ | |
/** | |
* @var \Magento\Framework\Registry | |
*/ | |
protected $_registry; |
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
Magento 2.4.2 or earlier: | |
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/my.log'); | |
$logger = new \Zend\Log\Logger(); | |
$logger->addWriter($writer); | |
Magento 2.4.3+: | |
$writer = new \Zend_Log_Writer_Stream(BP . '/var/log/my.log'); |
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 | |
use \Magento\Eav\Setup\EavSetup; | |
use \Magento\Framework\Setup\UpgradeDataInterface; | |
use \Magento\Framework\Setup\ModuleContextInterface; | |
use \Magento\Framework\Setup\ModuleDataSetupInterface; | |
use Magento\TestFramework\Helper\Eav; | |
/** UpgradeDataInterface */ | |
class UpgradeData implements UpgradeDataInterface |
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 | |
use \Magento\Eav\Model\Entity\Attribute\OptionManagementFactory; | |
use \Magento\Eav\Model\Entity\Attribute\OptionFactory; | |
use \Magento\Framework\Setup\UpgradeDataInterface; | |
use \Magento\Framework\Setup\ModuleContextInterface; | |
use \Magento\Framework\Setup\ModuleDataSetupInterface; | |
use \Magento\Framework\App\State; | |
class UpgradeData implements UpgradeDataInterface |
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
server { | |
listen 80; | |
server_name $1; ## Domain is here twice so server_name_in_redirect will favour the www | |
root /var/www/$2; | |
location / { | |
index index.html index.php; ## Allow a static html file to be shown first | |
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler | |
expires 30d; ## Assume all files are cachable | |
} |
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 | |
$folders = array("community", "local"); | |
$path = "app/code/"; | |
$filenotexists = array(); | |
foreach ($folders as $folder) { | |
echo $folder . "\n"; | |
$namespaces = scandir($path . $folder); |
NewerOlder