Skip to content

Instantly share code, notes, and snippets.

View imsamthomas's full-sized avatar
🎯
Focusing

Sam Ng imsamthomas

🎯
Focusing
View GitHub Profile
setup:upgrade
Installation issue: Cache cleared successfully
File system cleanup:
/var/www/html/var/generation/Composer
The directory "/var/www/html/var/generation/Composer/Console" cannot be deleted Warning!rmdir(/var/www/html/var/generation/Composer/Console): Directory not empty
/var/www/html/var/generation/Magento
The directory "/var/www/html/var/generation/Magento/AdminNotification/Controller/Adminhtml/Notification/AjaxMarkAsRead" cannot be deleted Warning!rmdir(/var/www/html/var/generation/Magento/AdminNotification/Controller/Adminhtml/Notification/AjaxMarkAsRead): Directory not empty
/var/www/html/var/generation/Symfony
The directory "/var/www/html/var/generation/Symfony/Component/Console/Input" cannot be deleted Warning!rmdir(/var/www/html/var/generation/Symfony/Component/Console/Input): Directory not empty
/var/www/html/var/di/plugins.ser
<?php
$pattern = '/{{([a-zA-Z]{0,10})(.*?)}}/si';
$string = '{{product.name}} aaa {{Product.sku}} aa444a {{Product.price}}';
preg_match_all($pattern, $string, $matches);
$helper = new helper();
if(isset($matches[0]) && is_array($matches[0])){
@imsamthomas
imsamthomas / cms.md
Last active August 15, 2016 10:37
magento 2 banner slider

{{block class="Mageplaza\BetterSlider\Block\Slider" template="Mageplaza_BetterSlider::slider.phtml" banner_id="1" }}

@imsamthomas
imsamthomas / onestepcheckout_payment.xml
Created August 8, 2016 09:54
onestepcheckout_payment.xml
<?xml version="1.0"?>
<!--
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* http://mageplaza.com/license-agreement/
*
Add code to template file
<?php echo $this->getLayout()->createBlock("Mageplaza\Sociallogin\Block\Buttons")->setTemplate("Mageplaza_Sociallogin::buttons.phtml")->setSocialNetworks('Google,Yahoo,Facebook')->toHtml(); ?>
You can put a social login button block on a CMS page
{{block class="Mageplaza\Sociallogin\Block\Buttons" name="buttons.sociallogin" template="Mageplaza_Sociallogin::buttons.phtml" social_networks="Google,Yahoo,Facebook"}}
Please copy and paste the code below to one of xml layout files where you want to show the social button block.
.mpcss{/*!
* Bootstrap v3.3.4 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/}
.mpcss html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.mpcss body{margin:0}.mpcss article,.mpcss aside,.mpcss details,.mpcss figcaption,.mpcss figure,.mpcss footer,.mpcss header,.mpcss hgroup,.mpcss main,.mpcss menu,.mpcss nav,.mpcss section,.mpcss summary{display:block}.mpcss audio,.mpcss canvas,.mpcss progress,.mpcss video{display:inline-block;vertical-align:baseline}.mpcss audio:not([controls]){display:none;height:0}.mpcss [hidden],.mpcss template{display:none}.mpcss a{background-color:transparent}.mpcss a:active,.mpcss a:hover{outline:0}.mpcss b,.mpcss strong{font-weight:700}.mpcss dfn{font-style:italic}.mpcss h1{margin:.67em 0}.mpcss mark{background:#ff0;color:#000}.mpcss sub,.mpcss sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.mpcss sup{top:-.5em}.mpcss sub{bottom
// Install server
apt-get update
apt-get upgrade
apt-get install apache2 mysql-server mysql-client php5 libapache2-mod-php5 php5-mysql php5-mcrypt php5-cgi php5-cli php5-common php5-curl php5-dbg php5-gd php5-gmp php5-ldap php5-odbc php5-pgsql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-adodb proftpd phpmyadmin libcupsys2 samba samba-common -y
apt-get install apache2 mysql-server mysql-client php5 libapache2-mod-php5 php5-mysql php5-mcrypt php5-cgi php5-cli php5-common php5-curl php5-dbg php5-gd php5-gmp php5-ldap php5-odbc php5-pgsql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-adodb phpmyadmin -y
<pre>Zend_Db_Statement_Exception Object
(
[_previous:Zend_Exception:private] =>
[message:protected] => SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-lunar_menulink' for key 'UNQ_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE'
[string:Exception:private] =>
[code:protected] => 23000
[file:protected] => /home/lunartxs/domains/lunar2t1.xstore.co.il/public_html/lib/Zend/Db/Statement/Pdo.php
[line:protected] => 234
[trace:Exception:private] => Array