Skip to content

Instantly share code, notes, and snippets.

Avatar

Jimmy Rittenborg JimmyRittenborg

View GitHub Profile
@JimmyRittenborg
JimmyRittenborg / config.php
Last active Feb 15, 2018
Change Guggenheim Gallery default kirbytext tag from `gallery` which may collide with other plugins etc.
View config.php
<?php
c::set('guggenheim.kirbytext.tagname','guggenheim');
//..
@JimmyRittenborg
JimmyRittenborg / local-dev-resolver.sh
Last active Sep 14, 2017
Hot to use dnsmasq to resolve to all your local *.dev sites on macOS
View local-dev-resolver.sh
#!/bin/bash
if test ! $(which brew); then
echo "Installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo -e "\n\nChecking for brew updates..."
echo "=============================="
@JimmyRittenborg
JimmyRittenborg / image-autothumb-kirbytexttag.php
Created Nov 29, 2015
This ia a rough example of making the image kirbytext tag support PhotoSwipe and automatically generate thumbnails. (Works - but not tested entirely through)
View image-autothumb-kirbytexttag.php
<?php
// Custom image kirbytag highjack
// This file should reflect the image tag functionality found in /kirby/extensions/tags.php
kirbytext::$tags['image'] = array(
'attr' => array(
'width',
'height',
'alt',
'text',
View guggenheim-styles.css
.guggenheim {
max-width: 100%;
box-sizing: content-box;
}
.guggenheim__ratio-container {
position: relative;
}
.guggenheim__figure,
.guggenheim__link,
.guggenheim__image {
@JimmyRittenborg
JimmyRittenborg / main.scss
Last active Oct 5, 2015
PhotoSwipe - Aspect Ratio Fix
View main.scss
/*
Add these in the main.scss that ships with PhotoSwipe.
*/
.pswp__item--ratiofix .pswp__img:last-child {
opacity: 0.001;
will-change: opacity;
transition: opacity $pswp__show-hide-transition-duration cubic-bezier(.4,0,.22,1);
}
@JimmyRittenborg
JimmyRittenborg / compress.liquid
Last active Oct 26, 2020
HTML Compressor in Shopify Liquid
View compress.liquid
{% comment %}
Input
{% endcomment %}{% capture _content %}{{ content }}{% endcapture %}{% comment %}
Remove redundant closing tags
{% endcomment %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% for _element in _endings %}
{% capture _end %}</{{ _element }}>{% endcapture %}
@JimmyRittenborg
JimmyRittenborg / image.php
Created Nov 10, 2014
Force a thumbnail for the kirbytext image tag. Place this in /site/tags/image.php
View image.php
<?php
// This file should reflect the image tag functionality found in /kirby/extensions/tags.php
// image tag
kirbytext::$tags['image'] = array(
'attr' => array(
'width',
'height',
You can’t perform that action at this time.