Skip to content

Instantly share code, notes, and snippets.

View nathanhornby's full-sized avatar

Nathan Hornby nathanhornby

View GitHub Profile
@nathanhornby
nathanhornby / Abffilter Role Manager replacement
Created July 26, 2014 19:24
Replace in members/extension.driver.php when using Symphony's Abffilter
/*-------------------------------------------------------------------------
Role Manager: (replace in members/extension.driver.php when using Abffilter)
-------------------------------------------------------------------------*/
public function checkFrontendPagePermissions($context) {
$isLoggedIn = false;
$errors = array();
// Checks $_REQUEST to see if a Member Action has been requested,
// member-action['login'] and member-action['logout']/?member-action=logout
<airports>
<airport iata="AAA">Anaa Airport</airport>
<airport iata="AAB">Arrabury Airport</airport>
<airport iata="AAC">El Arish International Airport</airport>
<airport iata="AAE">Annaba Airport</airport>
<airport iata="AAF">Apalachicola Regional Airport</airport>
<airport iata="AAG">Arapoti Airport</airport>
<airport iata="AAH"></airport>
<airport iata="AAI">Arraias Airport</airport>
<airport iata="AAJ">Cayana Airstrip</airport>
<!-- Start -->
<xsl:apply-templates select="airports/airport">
<xsl:with-param name="position" select="'start'" />
</xsl:apply-templates>
<!-- End -->
<xsl:apply-templates select="airports/airport">
<xsl:with-param name="position" select="'end'" />
</xsl:apply-templates>
@nathanhornby
nathanhornby / General notification template
Last active August 29, 2015 14:06
An email template for Symphony CMS notifications
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
omit-xml-declaration="yes"
encoding="UTF-8"
indent="yes" />
<xsl:template match="/">
<?php
class extension_custom_api extends Extension {
public function about() {
return array(
'name' => 'Custom API',
'version' => '1.0',
'release-date' => '2012-22-08',
'author' => array(
'name' => '3Degrees Agency',
@nathanhornby
nathanhornby / alchemist.tmTheme
Created December 12, 2015 23:44
A Sublime Text theme specifically optimised for Elixir. Work in progress.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Alchemist</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@nathanhornby
nathanhornby / main.styl
Created January 16, 2016 11:19
Import stylus
// Includes
@import 'jeet'
@nathanhornby
nathanhornby / fancylabels.html
Last active February 16, 2016 10:55
Form labels as placeholders. Accessible and swish (stylus, jquery, html)
<stylus>
form
width 600px
margin 0 auto
.field-block
position relative
height 55px
margin 10px 0
text-align left
label, input, textarea
@nathanhornby
nathanhornby / .htaccess
Created February 25, 2015 10:51
Browser caching
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
@nathanhornby
nathanhornby / magnific-velocity.js
Last active June 20, 2016 22:36
Magnific popup with velocity.js animation boilerplate
$.magnificPopup.open({
items: {
src: '#popup',
type: 'inline'
},
removalDelay: 400,
callbacks: {
open: function () {
this.content.velocity('transition.slideDownIn', {
duration: 400