array(4) {
'array_key_exists' =>
double(0.76186203956604)
'isset' =>
double(0.78142905235291)
'noCheck' =>
double(0.80179715156555)
'empty' =>
double(0.80491018295288)
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
javascript: (function () { function getIndentationLevel(row) { | |
const indentationDiv = row.querySelectorAll(".js-indentation"); | |
return indentationDiv.length; | |
} | |
function getParentRow(row) { | |
const currentIndentLevel = getIndentationLevel(row); | |
console.log(currentIndentLevel); | |
let previousRow = row.previousElementSibling; | |
while (previousRow) { |
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 | |
namespace App\Template\Partial; // src/Template/Partial/TooltipTpl.php | |
use League\Plates\Template\Template; | |
use League\Plates\Template\TemplateClassInterface; | |
use App\Plates\AbstractTemplate; | |
use App\Plates\TemplateExtension; | |
use function Symfony\Component\String\u; |
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
find . -type f -name "*.php" -exec sed -i '1i\ | |
<?php\ | |
\ | |
use My\\App\\Service\\PlatesTemplate;\ | |
\ | |
/**\ | |
* @var PlatesTemplate $this\ | |
*/\ | |
\ | |
?>' {} \; |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Optimiser sa title avec une taille parfaite !</title> | |
</head> | |
<input type=text placeholder="..." id=title> <div id=titleWidth></div> | |
<style> | |
#titleWidth { | |
font-size: 20px; | |
margin:0; |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<style> | |
h3 { | |
font-size: 20px; | |
margin:0; | |
padding:0; | |
border:0; | |
font-weight: 400; |
Create a new admin extending and overriding the default one. https://github.com/PiedWeb/CMS/blob/master/src/Admin/PageAdmin.php
$formMapper->add('mainContent', CKEditorType::class
Change the service with your new page admin class :
piedweb.admin.page:
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
// Share for educationnal purpose only | |
// -------------------- | |
// To remove ads or sidebar from twitter, just inject this code (via cjs for example) : | |
// Current code work for the new Twitter TL from you favorite navigator (january 2019) | |
// -------------------- | |
function removeSidebar() { | |
var elem = document.querySelector('[data-testid=sidebarColumn]'); | |
if (elem) elem.parentNode.removeChild(elem); | |
} |
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
composer require piedweb/github | |
php render.php |
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
/** | |
* Simple Image Lazy Loader | |
* @author: Robin D. https://www.robin-d.fr/ | |
* idea borrow from : https://davidwalsh.name/lazyload-image-fade | |
* Example : <span data-img="https://source.unsplash.com/collection/993239/600x400">Random Image from Unsplash</span> | |
* will be transform to : <img src="https://source.unsplash.com/collection/993239/600x400" alt="Random Image from Unsplash" /> | |
*/ | |
export function imgLazyLoad() { | |
[].forEach.call(document.querySelectorAll('[data-img]'), function(img) { | |
let newDomImg = document.createElement('img'); |
NewerOlder