- Install SQUID
apt-get install squid- Create an user
htpasswd -md /etc/squid3/users myuserlogin`| <?php | |
| /** | |
| * Return (sub)domain from any string (with and without parse_url) | |
| * | |
| * @param $domain str | |
| */ | |
| function getDomain($domain) { | |
| $host = parse_url($domain, PHP_URL_HOST); | |
| if($host) |
| <?php | |
| /** | |
| * Convert a php array with date in a pĥp array with date wich are following itself day by day | |
| * | |
| * @param array $date containing the date | |
| * @param bool $dateInKey must be set to true if the dates are in the array's keys | |
| * @param string $fDate relative to the date format relative to php date's function | |
| * @return array with every one key for every day | |
| */ | |
| function normalizeDateArray(array $dates, $dateInKey = false, $fDate = 'Y-m-d') { |
| /** | |
| * Check if the params exist | |
| * | |
| * @param array $params | |
| * | |
| * @return bool | |
| */ | |
| function checkParams($params) { | |
| $params.forEach(function(param){ | |
| if(typeof casper.cli.options[param] == 'undefined') { |
apt-get install squidhtpasswd -md /etc/squid3/users myuserlogin`The usage is quite simple, just add a new listender to the node you want to observe and manipulate the classes as usually:
var $node = $('div')
// listen to class-manipulations
.on('addClass toggleClass removeClass', function (e, oldClass, newClass) {
console.log('Changed from %s to %s due %s', oldClass, newClass, e.type);
})| /** | |
| * 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'); |
| composer require piedweb/github | |
| php render.php |
| // 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); | |
| } |
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:
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <style> | |
| h3 { | |
| font-size: 20px; | |
| margin:0; | |
| padding:0; | |
| border:0; | |
| font-weight: 400; |