This file contains 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
/** | |
* Vertically center an element's children. | |
*/ | |
%vertical-center { | |
display: table; | |
> * { | |
display: table-cell; | |
vertical-align: middle; | |
} |
This file contains 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
/** | |
* Change class when element is in view | |
*/ | |
var elementTop = $(".container").offset().top; | |
$(window).on("scroll", function updateClassWhenInView() { | |
if ($(window).scrollTop() > elementTop - window.innerHeight * 0.9) { | |
$(window).off("scroll", updateClassWhenInView); | |
$(".element").removeClass("is-hidden").addClass("is-visible"); | |
} |
This file contains 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
/** | |
* Cross-browser image desaturation filter | |
* | |
* 1. Chrome 19+, Safari 6+, Safari 6+ iOS | |
* 2. Firefox 10+, Firefox on Android | |
* 3. IE6-9 | |
*/ | |
%greyscale { | |
-webkit-filter: grayscale(100%); /* [1] */ | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* [2] */ |
This file contains 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 | |
/** | |
* Return the number of Likes, Shares, or Comments of a given Fan Page. | |
*/ | |
function facebook_numbers( $url ) { | |
$fql = 'SELECT url, normalized_url, share_count, like_count, comment_count, '; | |
$fql .= 'total_count, commentsbox_count, comments_fbid, click_count FROM '; | |
$fql .= 'link_stat WHERE url = "' . $url . '"'; |
This file contains 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 | |
function _s_theme_options_init() { | |
register_setting( | |
'_s_options', // Options group, see settings_fields() call in _s_theme_options_render_page() | |
'_s_theme_options', // Database option, see _s_get_theme_options() | |
'_s_theme_options_validate' // The sanitization callback, see _s_theme_options_validate() | |
); | |
// Register our settings field group | |
add_settings_section( |
This file contains 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
/** | |
* Cross-browser opacity. | |
* | |
* 1. Even IE8 | |
* | |
* Usage: | |
* | |
@include opacity(0.8); | |
* | |
*/ |
This file contains 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
<!-- | |
Clean, efficient, complex content elements. | |
--> |
This file contains 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
/** | |
* Image replacement | |
* | |
* 1. Dimensions of replacement image | |
* 2. Fix for Firefox 2- | |
* 3. Required for IE8 if no `a:hover` styles declared | |
* | |
* Usage: | |
<a class="nir" href="[url]">[text]</a> | |
* |
This file contains 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
/** | |
* A selection of handy code snippets, plugins, and best practices for WordPress development. | |
* | |
*/ |
This file contains 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
/** | |
* A very simple, pragmatic Sass mixin for generating any property with an rgba() colour | |
* and its associated fallback (sourced from the original rgba() colour). | |
* | |
* Do not use if you require a fallback vastly different from the rgba(). | |
* | |
* 1. Strip the alpha value and write out a solid rgb() color. | |
* 2. Drop the red, green, blue, and alpha paramaters into the relevant places. | |
* | |
h1 { |