Skip to content

Instantly share code, notes, and snippets.

Avatar
🇮🇪

T.J. Fogarty tjFogarty

🇮🇪
View GitHub Profile
View ext.navee_static_menu.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ExpressionEngine - by EllisLab
*
* @package ExpressionEngine
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
* @license http://expressionengine.com/user_guide/license.html
* @link http://expressionengine.com
@tjFogarty
tjFogarty / search.html
Last active Aug 29, 2015
Rivets + Fuse search
View search.html
<div class="js-course-search">
<input type="search" placeholder="Search courses..." rv-on-keyup="search.update" autofocus>
<ul>
<li rv-each-result="search.results">
<a rv-href="result.url">
{result.name}
</a>
</li>
View inview-call.js
/* globals $, LoadPartial, Foundation */
/* jshint node:true */
'use strict';
/**
* The Likebox is just above the footer on the homepage
* Load it once it comes into view
*/
var fb = new LoadPartial({
@tjFogarty
tjFogarty / navigation.js
Last active Aug 29, 2015
Handle mobile navigation
View navigation.js
/*global module, $, _, matchMedia*/
'use strict';
/**
* Navigation
* Disclaimer: This is built with jQuery.mmenu in mind, and so some of the selectors and calls accommodate this
* Shouldn't be too hard to swap this out for a different menu solution
*
* @param config
@tjFogarty
tjFogarty / srcset.html
Created Feb 25, 2015
Example of srcset and sizes
View srcset.html
<img
srcset="/path/to/slider-image-small.jpg 400w,
/path/to/slider-image-medium.jpg 800w,
/path/to/slider-image-large.jpg 1200w"
sizes="100vw"
alt="...">
@tjFogarty
tjFogarty / Overlay.js
Created Apr 6, 2015
Full-screen overlay
View Overlay.js
/*globals $, TweenLite, Power3*/
/*jshint node:true*/
'use strict';
/**
* Overlay
*
* Controls creating, showing, hiding and removing of overlays
*/
View alert.css
.c-alert {
position: fixed;
background: #333;
background: rgba(51, 51, 51, 0.7);
bottom: 30px;
color: #fff;
text-align: center;
padding: 15px;
border-radius: 4px;
width: 300px;
@tjFogarty
tjFogarty / overview.php
Created Apr 16, 2015
WordPress + Timber example
View overview.php
<?php
/**
* Template Name: Overview
*/
if (!class_exists('Timber')){
echo 'Timber not activated. Make sure you activate the plugin in <a href="/wp-admin/plugins.php#timber">/wp-admin/plugins.php</a>';
return;
}
@tjFogarty
tjFogarty / base.twig
Last active Aug 29, 2015
Example base.twig for use with Timber plugin for WordPress
View base.twig
<!doctype html>
<html class="no-js" {{site.language_attributes}}>
<head>
<meta charset="{{site.charset}}">
<title>
{% if wp_title %}
{{ wp_title }} - {{ site.name }}
{% else %}
{{ site.name }}
@tjFogarty
tjFogarty / test-wp-search-form.js
Created Aug 11, 2015
Testing WordPress Search Form with CasperJS
View test-wp-search-form.js
/*global casper*/
'use strict';
var config = require('../config'),
page = 'http://' + config.local_url + '/',
formData = {
's': 'suppliers' // search term
};