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
function getSassyJSON() { | |
var style = null; | |
var json = null; | |
// Get the json string from CSS | |
if ( window.getComputedStyle && window.getComputedStyle(document.body, '::before') ) { | |
style = window.getComputedStyle(document.body, '::before'); | |
style = style.content; | |
} |
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 | |
// Delete all revisions from all posts in either a network or a single blog. | |
// Quick hack by @mrazzari, 2014. | |
// For context see this thread started by Kitchin at the forums: | |
// http://wordpress.org/support/topic/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere | |
// HOWTO | |
// This snippet is meant to be called as a standalone script. | |
// Like http://example.com/tmp/multisite_delete_revisions.php |
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 | |
/** | |
* An is_blog() conditional function for Wordpress. | |
* | |
* Determines if the current page is blog(y), including: | |
* | |
* - Posts page | |
* - Archive (category, tag, author) | |
* - Single post |
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 | |
//Display Fields | |
add_action( 'woocommerce_product_after_variable_attributes', 'my_variable_fields', 10, 2 ); | |
//JS to add fields for new variations | |
add_action( 'woocommerce_product_after_variable_attributes_js', 'my_variable_fields_js' ); | |
//Save variation fields | |
add_action( 'woocommerce_process_product_meta_variable', 'my_save_variable_fields', 10, 1 ); | |
/** |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> | |
<script type="text/javascript">FB.init("INSERT-YOUR-API-KEY");</script> | |
<fb:fan profile_id="INSERT-YOUR-PAGE-ID" connections="10" width="300" height="210" css="http://yoursite.com/path-to-your-stylesheet/style.css?5"></fb:fan> |
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
/** | |
* Simple Twitter status getter. | |
* @param string $handle User Twitter handle | |
* @param integer $count Desired number of tweets | |
* @return array Indexed array of tweets | |
*/ | |
function dev_get_twitter_timeline($handle, $count = 3) { | |
// WP template tag | |
$save = get_stylesheet_directory() . '/assets/twitter.json'; | |
$time = time(); |
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
// Add quotes to an element. | |
// | |
// Parameters: | |
// | |
// * [optional] `size` -- Size, in em of the quotes | |
// * [optional] `padding` -- Top-left padding on lefthand quote | |
// * [optional] `left` -- Left quote glyph | |
// * [optional] `right` -- Right quote glyph | |
@mixin my-quotes($size: 1.3em, $padding:false, $left:'\201C', $right:'\201D') { | |
&:after, &:before { font-size: $size; } |
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
#!/bin/bash | |
## v1.0.6 | |
## this script will gernerate css stats | |
### example output | |
# CSS STATS | |
# ---------- | |
# Floats: 132 |
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
@import "compass/css3"; | |
// Add outward pointing arrows (triangles) to the sides of a box that has borders. (CSS triangles obviously | |
// based on Chris Coyier's CSS triangle. http://css-tricks.com/snippets/css/css-triangle.) | |
// | |
// Parameters: | |
// | |
// * `direction` -- What side of the box and direction of the arrow | |
// * `flatten` -- An *even numbered* factor of flattening the triangle (MUST be a even number) | |
// * `arrowBaseLength` -- Width or height of the arrow's base |
OlderNewer