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
login url | |
<?php echo Mage::getUrl('customer/account/login'); ?> | |
logout url | |
<?php echo Mage::getUrl('customer/account/logout'); ?> | |
My Account url | |
<?php echo Mage::getUrl('customer/account'); ?> | |
Register url |
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
console.log(JSON.stringify(obj, null, 4)) |
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
var width = 500; | |
height = 500; | |
widthScale = d3.scale.linear() | |
.domain([0,60]) | |
.range([0,height]); | |
heightScale = d3.scale.linear() | |
.domain([60,0]) | |
.range([0,height]); | |
axis = d3.svg.axis() | |
.ticks(5) |
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
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log'); | |
$logger = new \Zend\Log\Logger(); | |
$logger->addWriter($writer); | |
$logger->info($object->debug()); |
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
$e = new \Exception; | |
echo "<pre>"; | |
var_dump($e->getTraceAsString()); | |
echo "</pre>"; | |
die("test"); |
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
sudo php -i > ./php-info.txt |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
cmd shift fn f12 ----- hides everythings | |
cmd N ----- create file / class / directory | |
double shift ----- search everywhere | |
cmd O ----- go to a particular file / class /index. i.e Class.index or Class:41 for lines | |
Shift Cmd N ----- scratch files | |
shift cmd A ----- search for action | |
shift cmd -> ----- resize windows | |
ald shift up ----- move text up / down | |
shift cmd V ----- show clipboard | |
alt shift click ----- multiple cursors |
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
# get max min of list | |
max(list) | |
min(list) | |
# sort a list | |
list.sort() | |
sorted(list) | |
# sort a list by a specific value | |
sorted(list, key = lambda x : x[2]) |
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\Framework\App\Bootstrap; | |
require __DIR__ . '/app/bootstrap.php'; | |
$bootstrap = Bootstrap::create(BP, $_SERVER); | |
$obj = $bootstrap->getObjectManager(); | |
$state = $obj->get('Magento\Framework\App\State'); | |
$state->setAreaCode('frontend'); |
OlderNewer