Skip to content

Instantly share code, notes, and snippets.

View eheiser's full-sized avatar
🏠
Working from home

Erwin Heiser eheiser

🏠
Working from home
View GitHub Profile
@davist11
davist11 / pl.plugin.php
Created November 27, 2012 21:36
Picturefill method from plugin
Output the picturefill HTML, so you don't have to repeat it all over the templates.
- Param: big_img, src for big image
- Param: small_img, src for small image
- Param: alt, alt attribute for image
- Param: media_query, media query to use, defaults to (min-width: 600px)
- Param: class, class for wrapper, defaults to hero
Example Usage:
{exp:vl:picturefill
big_img="{custom_field_name}"
@jamiepittock
jamiepittock / ExpressionEngine template
Created November 23, 2012 11:48
Inject events from low_events:entries into low_events:calendar cells
{exp:low_events:calendar
events_field="cf_events_date_time"
date="{freebie_4}"
}
<table class="calendar" cellspacing="0" cellpadding="0">
<thead>
<tr id="month_pager">
<th colspan="1" class="previous"><a href="{structure:page:uri}
on/{prev_month_url}" title="{prev_month format='%F %Y'}">&larr;</a></th>
<th colspan="5" class="month_title"><a href="{structure:page:uri}
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@moonbeetle
moonbeetle / ee_stash_zurb_block-grids.txt
Created May 24, 2012 14:42
EE-Stash-ZURBFoundation-block-grid-images
{!--
Conditionally output up to three images in a Foundation block-grid
Assumptions:
* Channel "Pages" (pages)
* Custom field "cf_page_images"
* Addons : P&T Assets, Croxton's Stash, Switchee
* Assets field set to allow multiple images
* Template uses ZURB Foundation framework
* Limit is set to three images, but ZURB Foundation block-grids go up till five
--}
@jamiepittock
jamiepittock / gist:1360275
Created November 12, 2011 09:09
Update profile form
{embed="layout/_start"
body_class=""
section=""
{!-- BETTER META OPTIONS BELOW --}
title=""
title_suffix=""
title_prefix=""
description=""
keywords=""
robots_index=""
@jamiepittock
jamiepittock / gist:1360274
Created November 12, 2011 09:07
Update password form
{embed="layout/_start"
body_class=""
section=""
{!-- BETTER META OPTIONS BELOW --}
title=""
title_suffix=""
title_prefix=""
description=""
keywords=""
robots_index=""
@mathiasbynens
mathiasbynens / README.md
Created April 22, 2011 08:06
Improved swipe gestures plugin for jQuery

Improved swipe gestures plugin for jQuery

What was changed (compared to the original v0.1.2):

  • Don’t modify the default settings internally.
  • Merge the options recursively (deep copy) so that the custom threshold values actually get used.
  • Allow overriding the options globally through $.fn.swipe.options.
  • Use namespaced jQuery events (using the swipe namespace) instead of DOM2 addEventListener to prevent errors in old IEs.
  • Simplified and optimized code.
  • Changed swipeLeft and swipeRight functions to be called within the context of the bound element. Thanks, @kswedberg!
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@getify
getify / gist:675496
Created November 13, 2010 17:18
detecting if flash plugin is installed
var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false));