Skip to content

Instantly share code, notes, and snippets.

View hadl's full-sized avatar

Andreas von Bibow hadl

View GitHub Profile
<?php
/**
* Color Input Editable
*/
namespace AppBundle\Model\Document\Tag;
use Pimcore\Model\Document\Tag\Input;
class Color extends Input
@hadl
hadl / slider-lazysizes.js
Last active July 1, 2020 08:20
Flickity & Lazysizes
/* eslint-disable no-underscore-dangle,prefer-rest-params */
import Flickity from 'flickity';
(() => {
const oldFlickityCreate = Flickity.prototype._create;
Flickity.prototype._create = function create() {
const that = this;
if (this.element.addEventListener) {
@hadl
hadl / slider-prev-next-buttons.js
Created July 1, 2020 08:23
Flickity next/prev buttons disable on "last page" when using contain
import Flickity from 'flickity';
(() => {
const { PrevNextButton } = Flickity;
const parentUpdate = PrevNextButton.prototype.update;
PrevNextButton.prototype.update = function update() {
parentUpdate.call(this);
if (this.parent.slideableWidth < this.parent.size.innerWidth) {
@hadl
hadl / alter-twig.php
Last active May 27, 2021 13:47
patternlab node - engine-twig-php extend/alter twig
<?php
/**
* @param Twig_Environment $env - The Twig Environment - https://twig.symfony.com/api/1.x/Twig_Environment.html
* @param $config - Config of `@basalt/twig-renderer`
*/
function addCustomExtension(\Twig_Environment &$env, $config) {
$env->addExtension(new \Twig_Extension_Debug());
/**