curl -LO https://deployer.org/deployer.phar && sudo mv deployer.phar /usr/local/bin/dep && sudo chmod +x /usr/local/bin/dep
composer require deployer/recipes --dev
composer require rafaelstz/deployer-magento2 dev-master --dev
This is a quick guide to install PostgreSQL 10 - tested on Ubuntu 16.04 but likely can be used for Ubuntu 14.04 and 17.04 as well, with one minor modification detailed below.
To make life simple, remove all other versions of Postgres. Obviously not required, but again, makes life simple.
dpkg -l | grep postgres
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
# run script to container Docker | |
# -u 0 => root | |
docker exec -u 0 -ti CONTAINERID python /path/to/shell-scripts/script.py |
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
# -*- coding: utf-8 -* | |
from odoo import models, fields, api | |
class ProductProduct(models.Model): | |
_inherit = 'product.product' | |
brand = fields.Many2one( | |
'product.brand', | |
string="Brand" | |
) |
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
package main | |
import ( | |
"fmt" | |
"strconv" | |
"strings" | |
) | |
// condition|rate|percent | |
var taxRates = [4]string{"<=|50000000|5", "<=|250000000|15", "<=|500000000|25", ">=|500000001|30"} |
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
// JSON Unmarshal into struct Example | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"github.com/gin-gonic/gin" |
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
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php | |
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100 | |
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100 | |
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url | |
$this->_rewrite = $rewrite; | |
return $requestPath; | |
} | |
+ | |
+ // avoid unnecessary creation of new url_keys for duplicate url keys | |
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix))); |
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 | |
rm -rf generated | |
# please careful! make sure working properly | |
php -d memory_limit=-1 bin/magento module:enable --all | |
php -d memory_limit=-1 bin/magento setup:upgrade | |
php -d memory_limit=-1 bin/magento setup:di:compile | |
rm -rf pub/static/* | |
php -d memory_limit=-1 bin/magento setup:static-content:deploy -f |
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 | |
// salt random string | |
// see formula: app/code/core/Mage/Core/Helper/Data.php method getRandomString | |
function salt($len = 32) { | |
$chars_lowers = 'abcdefghijklmnopqrstuvwxyz'; | |
$chars_uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
$charts_digits = '0123456789'; | |
$chars = $chars_lowers . $chars_uppers . $charts_digits; | |
for ($i = 0, $str = '', $lc = strlen($chars)-1; $i < $len; $i++) { |
NewerOlder