Skip to content

Instantly share code, notes, and snippets.

View JimmyRittenborg's full-sized avatar

Jimmy Rittenborg JimmyRittenborg

View GitHub Profile
@JimmyRittenborg
JimmyRittenborg / config.php
Last active February 15, 2018 22:58
Change Guggenheim Gallery default kirbytext tag from `gallery` which may collide with other plugins etc.
<?php
c::set('guggenheim.kirbytext.tagname','guggenheim');
//..
@JimmyRittenborg
JimmyRittenborg / local-dev-resolver.sh
Last active February 8, 2021 16:05
Hot to use dnsmasq to resolve to all your local *.dev sites on macOS
#!/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 November 29, 2015 19:06
This ia a rough example of making the image kirbytext tag support PhotoSwipe and automatically generate thumbnails. (Works - but not tested entirely through)
<?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',
.guggenheim {
max-width: 100%;
box-sizing: content-box;
}
.guggenheim__ratio-container {
position: relative;
}
.guggenheim__figure,
.guggenheim__link,
.guggenheim__image {
@JimmyRittenborg
JimmyRittenborg / README.md
Last active November 28, 2015 20:44
PhotoSwipe for Guggenheim Gallery for Kirby https://github.com/SiteMarina/guggenheim
@JimmyRittenborg
JimmyRittenborg / main.scss
Last active October 5, 2015 22:57
PhotoSwipe - Aspect Ratio Fix
/*
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 June 17, 2023 12:11
HTML Compressor in Shopify 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 November 10, 2014 04:15
Force a thumbnail for the kirbytext image tag. Place this in /site/tags/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',