Skip to content

Instantly share code, notes, and snippets.

View craigrodway's full-sized avatar

Craig A Rodway craigrodway

View GitHub Profile
@craigrodway
craigrodway / FieldtypeForms.module
Created November 17, 2013 17:11
Very simple Fieldtype that lists FormBuilder forms in a select box on editing pages.
<?php
/**
* ProcessWire Form Fieldtype.
* Stores reference to a single FormBuilder Form to allow easy selection on pages.
*
* ProcessWire 2.x
* Copyright (C) 2012 by Ryan Cramer
* Licensed under GNU/GPL v2, see LICENSE.TXT
*
#!/bin/bash
#
# ProcessWire upgrade script
#
# Upgrades ProcessWire ./wire directory.
# Use either master of dev branch.
#
#
@craigrodway
craigrodway / Gravatar.module
Last active February 22, 2017 15:38
ProcessWire gravatar
<?php
/**
* Basic shell of a module for generating Gravatar URLs for ProcessWire users.
*
* Mostly based on official implementation guidance here:
* https://en.gravatar.com/site/implement/images/php/
*
*
* Use it like this:
@craigrodway
craigrodway / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@craigrodway
craigrodway / Bookings.php
Last active March 21, 2019 22:40
classroombookings duplicate fix
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Bookings extends MY_Controller
{
public function __construct()
{
parent::__construct();
@craigrodway
craigrodway / cols_periods.php
Created May 27, 2019 11:33
classroombookings: 24hr time format
<!-- application/views/bookings/table/cols_periods.php -->
<td align="center" width="<?php echo $width ?>">
<strong><?php echo html_escape($name) ?></strong><br />
<span style="font-size:90%">
<?php echo date('H:i', strtotime($time_start)).'-'.date('H:i', strtotime($time_end)) ?>
</span>
</td>
@craigrodway
craigrodway / SqlFormatterPlugin.php
Last active October 27, 2025 17:58
SqlFormatterPlugin
<?php
namespace AdminNeo;
use AdminNeo\Plugin;
/**
* Add a 'Format SQL' button to query textarea.
*
* @uses SQL Formatter, https://www.npmjs.com/package/sql-formatter