Magento 1.x:
Mage::getStoreConfig('carriers/shipper/active')
Magento 2.x (using constructor injection):
protected $scopeConfig;
<?php | |
/** | |
* PHP version 5.4 | |
* @category Export | |
* @package Language | |
* @author Tim Neutkens <tim@weprovide.com> | |
* @license MIT <https://opensource.org/licenses/MIT> | |
* @link <weprovide.com> | |
*/ |
import {useState, useEffect} from 'react' | |
function useMounted() { | |
const [isMounted, setMounted] = useState(false) | |
useEffect(() => setMounted(true), []) | |
return isMounted | |
} | |
// const isMounted = useMounted() |
# Uses these 2 tools: | |
# http://wp-cli.org/ | |
# https://github.com/xwp/wp-cli-ssh | |
# Remote to local | |
wp ssh db export - --host=production | wp db import - | |
# Local to remote BEWARE THIS IS DANGEROUS BUT KEPT AS REFERENCE | |
wp db export - | wp ssh db import - --host=production |
Magento 1.x:
Mage::getStoreConfig('carriers/shipper/active')
Magento 2.x (using constructor injection):
protected $scopeConfig;
require('dotenv').config(); | |
const withCSS = require('@zeit/next-css'); | |
const path = require('path'); | |
const Dotenv = require('dotenv-webpack'); | |
const withImages = require('next-images'); | |
const withTypescript = require('@zeit/next-typescript'); | |
const withOffline = require('next-offline'); | |
const {PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD} = require('next/constants') |
const TOP_PATHS = new Set( | |
readdirSync(join(__dirname, '..', 'pages')) | |
.map(f => f.replace(/\.js$/, '')) | |
.concat(['', 'static', '_next']) | |
) | |
function topRoutesMiddleware(req, res, goNext) { | |
const topPath = req.path.split('/', 2)[1] |
export default function importScript(src) { | |
return new Promise((resolve, reject) => { | |
const loaded = Boolean(document.querySelector(`script[src="${src}"]`)) | |
if (loaded) return resolve() | |
const script = document.createElement('script') | |
script.type = 'text/javascript' | |
script.src = src | |
script.async = true |
<?php | |
/** | |
* Small utility function to get an excerpt. Standard length is 100 characters | |
* | |
* @param $string | |
* @param int $start_postion | |
* @param int $max_length | |
* | |
* @return string | |
*/ |
sorted by rerender time
Solution | Use CSS | Use Inline-Styles | Mount Time (ms) | Rerender time (ms) |
---|---|---|---|---|
react (without styles) | - | - | 16.11 | 29.96 |
styled-jsx-static | + | - | 25.27 | 42.24 |
emotion-extract-static | + | + | 52.29 | 44.79 |
react-css | + | + | 28.17 | 46.18 |
styletron | + | - | 53.03 | 47.36 |
alias ip='dig +short myip.opendns.com @resolver1.opendns.com' |