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
Go to Magentto root from command line and run following command. | |
php bin/magento indexer:reindex |
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
Type | Maximum length | |
-----------+------------------------------------- | |
TINYTEXT | 255 (2 8−1) bytes | |
TEXT | 65,535 (216−1) bytes = 64 KiB | |
MEDIUMTEXT | 16,777,215 (224−1) bytes = 16 MiB | |
LONGTEXT | 4,294,967,295 (232−1) bytes = 4 GiB | |
Note that the number of characters that can be stored in your column will depend on the character encoding. |
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 | |
class String{ | |
public static function truncate($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) { | |
if ($considerHtml) { | |
// if the plain text is shorter than the maximum length, return the whole text | |
if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) { | |
return $text; | |
} | |
// splits all html-tags to scanable lines | |
preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); |
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
/** | |
* truncate_html() | |
* | |
* Truncates a HTML string to a given length of _visisble_ (content) characters. | |
* E.g. | |
* "This is some <b>bold</b> text" has a visible/content length of 22 characters, | |
* though the total string length is 29 characters. | |
* This function allows you to limit the visible/content length whilst preserving any HTML formatting. | |
* | |
* @param string $html |
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 | |
/** | |
* Website: http://sourceforge.net/projects/simplehtmldom/ | |
* Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/) | |
* Contributions by: | |
* Yousuke Kumakura (Attribute filters) | |
* Vadim Voituk (Negative indexes supports of "find" method) | |
* Antcs (Constructor with automatically load contents either text or file/url) | |
* | |
* all affected sections have comments starting with "PaperG" |
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
$segments = preg_split('/[\s]+/', $string ); | |
check url exist in string | |
filter_var($process_content, FILTER_VALIDATE_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
$ch = curl_init(); // create curl handle | |
$url = "url"; | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch,CURLOPT_POST, true); | |
curl_setopt($ch,CURLOPT_POSTFIELDS, array('data' => data_value)); | |
curl_setopt($ch,CURLOPT_URL,$url); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array( | |
'param1: value_param1', | |
'Content-Type: application/json', |
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
$di->setShared('logger', function(){ | |
$formatter = new \Phalcon\Logger\Formatter\Line('%date% %type% %message%'); | |
$logger = new \Phalcon\Logger\Adapter\File('phalcon.log'); | |
$logger->setLogLevel(\Phalcon\Logger::DEBUG); | |
$logger->setFormatter($formatter); | |
return $logger; | |
}); |
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 gptads = document.createElement('script'); | |
gptads.setAttribute('type','text/javascript'); | |
gptads.setAttribute('src', 'your_source_file'); | |
if (gptads.addEventListener) | |
gptads.addEventListener('load', loadFunc, false); | |
document.getElementsByTagName('head')[0].appendChild(gptads); | |
function loadFunc() { | |
document.getElementById('txt_interests').innerHTML = interests; | |
document.getElementById('txt_gender').innerHTML = gender; |
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
// Example: | |
JavaScript.load("/javascripts/something.js"); | |
// With callback (that’s the good thing): | |
JavaScript.load("http://www.someawesomedomain.com/api.js", function() { | |
API.use(); // or whatever api.js provides ... | |
}); |