This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vngage.subscribe( message, func ); | |
vngage.subscribe('banner:join', function () { | |
console.log('banner:join triggered'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Switch-style checkboxes. | |
* Inspired by Espresso’s “Tools” switch | |
*/ | |
input[type="checkbox"]:not(:checked), | |
input[type="checkbox"]:checked { /* :checked here acting as a filter for older browsers */ | |
position: absolute; | |
opacity: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* iOS 6 style switch checkboxes | |
* by Lea Verou http://lea.verou.me | |
*/ | |
:root input[type="checkbox"] { /* :root here acting as a filter for older browsers */ | |
position: absolute; | |
opacity: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Props to emilejs for nice handling of easing and callbacks. | |
TODO: | |
opts.el - calculate positions | |
(in our case, we do that outside of this function already) | |
IE8+ ... el = (typeof el === 'string') ? document.querySelector(el) : el | |
use window.requestAnimationFrame instead of setInterval | |
- with polyfill of course |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myConsole = {}; | |
(function fixConsole(fakeConsole) { | |
fakeConsole.debug = true; | |
fakeConsole.breakOnErrors = true; | |
var methods = ['log', 'warn', 'error', 'info', 'dir']; | |
if (!window.console) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<!-- NOTES | |
Demo - uses IOS native scroll available in IOS5, but sidestep the document-bounce behavior. | |
another take on the solution first seen here: https://gist.github.com/1372229 | |
https://github.com/joelambert/ScrollFix/issues/2 | |
Tested on iPad 2, using IOS 5.0.1. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.serializeForm = function(){ | |
var result = {}; | |
$(this).serializeArray().forEach(function(item, i){ | |
if (item.name.length){ | |
result[item.name] = item.value; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define some sorting functions | |
function NumericSorter(a, b) { | |
var x = a[sortcol], y = b[sortcol]; | |
return sortdir * (x == y ? 0 : (x > y ? 1 : -1)); | |
} | |
function RatingSorter(a, b) { | |
var xrow = a[sortcol], yrow = b[sortcol]; | |
var x = xrow[3], y = yrow[3]; | |
return sortdir * (x == y ? 0 : (x > y ? 1 : -1)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//add excerpt field to pages as well, and not only posts: | |
function my_page_excerpt_meta_box() { | |
add_meta_box( 'postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'page', 'normal', 'core' ); | |
} | |
add_action( 'admin_menu', 'my_page_excerpt_meta_box' ); | |
//add Facts box to all pages | |
function my_facts_meta_box() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
jQuery.equalHeights Plugin | |
@author John Hunter | |
@dependency jQuery 1.4.x | |
EqualHeights version 2.0 (2010-09-07 johnhunter.info) | |
Based on an idea copyright (c) 2008 Rob Glazebrook (cssnewbie.com) | |
use: $('#selector').equalHeights({minHeight: 200}); | |
see defaults object for options | |