Skip to content

Instantly share code, notes, and snippets.

View kmgdevelopment's full-sized avatar

Kristen Grote kmgdevelopment

View GitHub Profile
@kmgdevelopment
kmgdevelopment / gist:8794724
Created February 3, 2014 23:40
In-Field Form Labels
$('form[data-infield]').on('keyup', 'input[type="text"], input[type="email"], textarea', function(){
var input = $(this);
input.toggleClass('not-empty', !!input.val());
});
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
<script>
var menu = $('#contact-content');
$('.sidebar #contact-heading').click(function(){
var heading = $(this);
if ( $(window).width() < 600 ) {
if( menu.is(':visible') ) {
menu.slideUp('fast');
if( heading.hasClass('open') ) {
@kmgdevelopment
kmgdevelopment / gist:3eaed832c2267cde8e25
Created May 5, 2014 20:37
CKEditor: Spell Check Custom Config
CKEDITOR.editorConfig = function(config) {
config.scayt_autoStartup = true;
};
@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}
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
@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;
@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: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: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);