Skip to content

Instantly share code, notes, and snippets.

@PunchRockgroin
PunchRockgroin / modalCloseOutside
Created January 12, 2014 19:23
Gumby close modal on click outside
$('.modal').on(Gumby.click, function(e){
var container = $('.content');
if((!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0)) // ... nor a descendant of the container
{
$('.modal .close').trigger('gumby.trigger');
}
});
@pmeissner
pmeissner / gist:6328273
Created August 24, 2013 13:55
statamic opengraph
{{ if segment_2 == slug }}
<meta property="og:title" content="{{ title }}">
<meta property="og:type" content="article">
<meta property="og:description" content="{{ content|striptags|truncate:200 }}">
<meta property="og:url" content="{{ permalink }}">
<meta property="og:image" content="{{ _site_url }}{{ transform src='{{ featured_image }}' width='1200' height='600' action='smart' }}">
<meta property="og:site_name" content="{{ _site_name }}">
<meta property="fb:admins" content="722169618">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@pmeissner">
{if structure:child_ids != '' OR structure:top:entry_id != {structure:page:entry_id}}
<div id="secondary-nav" class="widget">
<h3>Other Pages in <a href="{structure:top:uri}">{structure:top:title}</a>:</h3>
{exp:structure:nav
current_class="active"
start_from="/{segment_1}"
include_ul="yes"
}
</div>
{/if}
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@croxton
croxton / gist:3810681
Created October 1, 2012 10:08
Better Workflow > Assets integration
In ft.assets.php add this to the top of the pre_process function:
/**
* Pre Process
*/
function pre_process()
{
// -------------------------------------------
// Get the exp_assets_entries rows
// -------------------------------------------
@ckimrie
ckimrie / .htaccess
Created November 10, 2011 12:18
ExpressionEngine index.php removal with Google Analytics Compatibility
#################################################################################
#
# - ExpressionEngine index.php ModRewrite Removal -
# compatible with Google Analytics Tracking
#
##################################################################################
RewriteEngine on
@kevinthompson
kevinthompson / .htaccess
Created January 27, 2011 03:38
ExpressionEngine Rewrite Rules
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
@mrw
mrw / ExpressionEngine 2 Multi-Database Setup.php
Created November 1, 2010 16:00
Inside config/database.php: Use a switch statement and the active group in EE2 to set database information based on which server you're currently accessing.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Multiple if statements, or a switch statement,
// can handle as many environments as you need
if ($_SERVER['HTTP_HOST'] == "local-site.dev") {
$active_group = 'expressionengine';
} else {
$active_group = 'enginehosting';
}