Skip to content

Instantly share code, notes, and snippets.

View SpiritLevel's full-sized avatar

David Alexander SpiritLevel

View GitHub Profile
@SpiritLevel
SpiritLevel / GalleryPhoto.php
Last active October 8, 2015 02:47
Gallery with photos stored in folder determined by Address
<?php
class GalleryPhoto extends DataObject {
private static $db = array (
'Caption' => 'Varchar'
);
private static $has_one = array (
'Photo' => 'Image',
'ProjectPage' => 'ProjectPage'
@SpiritLevel
SpiritLevel / silverstripe-mode.el
Last active August 5, 2019 05:45
SilverStripe mode for Emacs
;; Taken from https://gist.github.com/mmichelli/1062600
;; replace html-mode with web-mode in line 4 to get more web-mode like behaviour
(define-derived-mode silverstripe-mode html-mode "Silverstripe"
(font-lock-add-keywords
nil
'(
("\\(<% \\| %>\\)" 1 font-lock-keyword-face)
("\\(\\(if\\|else\\|control\\|cacheblock\\|Level\\|end_[a-zA-Z1-9_\.]*\\|include\\)+\\)\\>" 1 font-lock-function-name-face)