Skip to content

Instantly share code, notes, and snippets.

View calebgrove's full-sized avatar

Caleb Grove calebgrove

View GitHub Profile
@fenixkim
fenixkim / config.php
Last active March 31, 2017 18:06
RederTime Class for Kirby CMS based on the dMOTION version (https://github.com/dmotion/kirby-rendertime)
<?
/*
----------
Rendertime
----------
This pluging is disabled by default, use this in your config.php file of your
develoment enviroment and set the 'rendertime' property to true as follow
@bastianallgeier
bastianallgeier / mywidget.php
Created March 9, 2015 10:54
Most basic widget setup for panel widgets. You would put those two files in /site/widgets/mywidget/
<?php
return array(
'title' => 'Widget Title',
'html' => function() {
// any data for the template
$data = array();
return tpl::load(__DIR__ . DS . 'template.php', $data);
}
);
@fitzage
fitzage / truncate.php
Last active October 9, 2015 08:37
Kirby plugin to truncate by number of words and preserve tags. Works with Kirby v2.
<?php
function truncate($input, $numwords, $padding="")
{
$output = strtok($input, " \n");
while(--$numwords > 0) $output .= " " . strtok(" \n");
if($output != $input) $output .= $padding;
// Original PHP code by Chirp Internet: www.chirp.com.au
// Please acknowledge use of this code by including this header.
$opened = array();