Skip to content

Instantly share code, notes, and snippets.

View kkemple's full-sized avatar

Kurt Kemple kkemple

View GitHub Profile
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
@kkemple
kkemple / fontStacks.css
Last active January 24, 2019 12:56
Font Stacks with all browser based fonts
/* Times New Roman-based stack */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* Modern Georgia-based serif stack */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
/* Traditional Garamond-based serif stack */
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
/* Helvetica/Arial-based sans serif stack */
@kkemple
kkemple / jqPubSub.js
Last active December 29, 2015 14:29
quick pub/sub with jQuery
/**
* Create an observer pattern for jQuery
* allows you to alias trigger with publish,
* on with subscribe,
* and off with unsubcsribe
* Useful for custom events
*
*USAGE:
* $(el).subscribe('customEvent', function() {
* do something when customEvent is published
@kkemple
kkemple / group.css
Created November 27, 2013 22:59
clear fixing class for css
.group {
*zoom: 1; /* ie 7 clearfix */
}
.group:before,
.group:after { /* modern browser clearfix */
content: ' ';
display: table;
}
@kkemple
kkemple / smartresize.js
Created November 27, 2013 23:04
stops browser from firing window resize events until window is no longer resizing ( so it only fires once )
//This fucntion stops the browser from firing multiple on resize events and executes code
//once the resizing stops
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
@kkemple
kkemple / getstaticblock.php
Created November 27, 2013 23:06
code snippet for getting a static blocks in Magento
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifier')->toHtml() ?>
@kkemple
kkemple / sudo-checkbox.js
Created November 27, 2013 23:08
code to create a sudo checkbox, this way you can add any styling you like
/**
* author kkemple@pixafy.com
*/
(function( $ ) {
$('body').on('click', '.check-style', function() {
var self = $( this );
var checkbox = self.children( 'input[type="checkbox"]' );
if( $( checkbox ).prop('checked') ) {
$( checkbox ).prop( 'checked', false );
@kkemple
kkemple / jqKonami.js
Created November 27, 2013 23:09
allows you to execute code after client correctly enters konami code
;(function( $, window, document, undefined ) {
var keys = [],
konami = '38,38,40,40,37,39,37,39,66,65',
timer = 0;
$( document ).keydown(function( e ) {
keys.push( e.keyCode );
if ( keys.toString().indexOf( konami ) >= 0 ){
// do something when the konami code is executed
@kkemple
kkemple / dumpAndDie.php
Created November 27, 2013 23:11
this allows you to var dump anything with code styling then dies
function dd( $anything )
{
echo '<pre>';
var_dump( $anything );
echo '</pre>';
die(0);
}
@kkemple
kkemple / gaq.js
Created November 27, 2013 23:12
Google analytic code
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>