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
Homebrew build logs for homebrew/php/php70-memcached on Mac OS X 10.11.6 | |
Build date: 2016-08-26 22:43:25 |
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
[mysqld] | |
max_allowed_packet=2G | |
innodb_file_per_table=OFF | |
wait_timeout=228800000 | |
connect_timeout=300 | |
# at least 250 | |
table_open_cache=1000 | |
open_files_limit=2048 | |
open-files-limit=2048 |
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. Stop mysql: | |
$ sudo service mysql stop | |
2. Step 2: Kill all running mysqld | |
$ sudo killall -9 mysqld | |
3. Step 3: Starting mysqld in Safe mode. | |
$ sudo mysqld_safe --skip-grant-tables --skip-networking & | |
4. Login as root |
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 | |
/** | |
* Observer change Customer group | |
* | |
* @category Rifki | |
* @package Rifki_MembershipGroup | |
* @author Muhamad Rifki | |
* @copyright rifkilabs.net | |
*/ | |
class Rifki_MembershipGroup_Model_Observer |
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++) { |
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
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
// 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
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
# -*- coding: utf-8 -* | |
from odoo import models, fields, api | |
class ProductProduct(models.Model): | |
_inherit = 'product.product' | |
brand = fields.Many2one( | |
'product.brand', | |
string="Brand" | |
) |