Skip to content

Instantly share code, notes, and snippets.

View kmgdevelopment's full-sized avatar

Kristen Grote kmgdevelopment

View GitHub Profile
@kmgdevelopment
kmgdevelopment / gist:53ee9ce1c861c80b623b
Last active August 29, 2015 14:08
ExpressionEngine: Get Entry ID from URL Segment w/ ActiveRecord Plugin
{exp:activerecord
select='entry_id'
from='channel_titles'
where:url_title='{segment_x}'
limit='1'
}
{exp:ce_cache:it tags='blog_listing'}
{embed='_global/document_head' template_name='blog-listing'}
{header}
<h1>Page Title</h1>
<p>Pellentesque auctor neque nec urna. Phasellus gravida semper nisi. Etiam feugiat lorem non metus. Sed libero. Phasellus nec sem in justo pellentesque facilisis.</p>
{footer}
@kmgdevelopment
kmgdevelopment / gist:daeb991aff8cf465c85a
Created October 15, 2014 17:32
Zoo Visitor Settings Rows
INSERT INTO `exp_zoo_visitor_settings` (`site_id`, `var`, `var_value`, `var_fieldtype`)
VALUES
(3, 'member_channel_id', '65', 'select'),
(3, 'anonymous_member_id', '50', 'select'),
(3, 'redirect_after_activation', 'no', 'select'),
(3, 'redirect_location', '', 'textinput'),
(3, 'email_is_username', 'no', 'select'),
(3, 'email_confirmation', 'no', 'select'),
(3, 'password_confirmation', 'yes', 'select'),
(3, 'use_screen_name', 'yes', 'select'),
@kmgdevelopment
kmgdevelopment / gist:d65824d0373072da2675
Created September 30, 2014 22:05
jQuery: Select All Elements Except the First
var $everythingBut = $('.container > *').not(':first-child');
@kmgdevelopment
kmgdevelopment / gist:2b7220c87e791d13cfe8
Last active August 29, 2015 14:06
Retina Media Queries
/* small screen, 72ppi */
.banner {
background-image: url(/assets/img/tmp/detail-s.jpg);
}
/* small screen, 192ppi */
@media screen and (max-width: 42.611em)
and (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dppx) {
.banner {
background-image: url(/assets/img/tmp/detail-s-2x.jpg);
@kmgdevelopment
kmgdevelopment / gist:ae40b144adc0d6c2ee94
Created September 18, 2014 18:49
Ajax Infinite Scroll + Masonry
var container = document.querySelector('.container');
var msnry = new Masonry( container, {
// options
itemSelector: '.item',
gutter: 10
});
var ias = $.ias({
container: ".container",
item: ".item",
@kmgdevelopment
kmgdevelopment / gist:b48b1500166fbba7a880
Created August 22, 2014 22:41
Sublime Text Snippet: Autocomplete PHP Tag
<snippet>
<content><![CDATA[<?php
${1}
?>]]></content>
<tabTrigger>&lt;?php</tabTrigger>
<description>PHP Tag Autocomplete</description>
</snippet>
@kmgdevelopment
kmgdevelopment / gist:eb7f84e6d0e200347a92
Created May 29, 2014 19:02
Enable Gzip & Vary: Accept-Encoding on MediaTemple DV/Nginx Server
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_types text/plain text/css text/javascript application/javascript application/x-javascript image/svg+xml;
gzip_vary on;
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
@kmgdevelopment
kmgdevelopment / structure_no_children
Created May 13, 2014 21:46
Structure Module: Display Content if the Current Page is Not Single and Childless
{if (structure:top:url == structure:page:url AND structure:child_ids != "") OR (structure:top:url != structure:page:url AND structure:child_ids == "") }
<!-- Sidebar Code or Whatever -->
{/if}