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
/** | |
* Debounce a function so that it will only fire once | |
* | |
* USAGE EXAMPLE: | |
* $scope.search = debounce(performSearch, 500); // Bind to ng-keyup | |
* | |
* http://davidwalsh.name/javascript-debounce-function | |
* | |
* @param func [Function] - The function to execute |
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 | |
/*************************** | |
* Custom implementation of the Embedly service | |
****************************/ | |
class Embedly_WordPress_Integration { | |
private $cache_ttl = WEEK_IN_SECONDS; | |
private $embedly_uri = 'http://api.embed.ly/1/oembed'; |
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 | |
######### router.php ######### | |
# | |
# This file implements basic server routing and rewrite rules; | |
# Run the following command from the project root: | |
# | |
# php -S localhost:5000 -t path/to/wordpress path/to/router.php | |
# | |
# ^ hostname ^ root ^ server router |
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
@mixin ui-scaffolding($color:"rgba(0,255,100)", $label:"PLACEHOLDER") { | |
position: relative; | |
outline: 1px solid $color; | |
background: rgba($color, 0.2); | |
&:before { | |
content: $label; | |
display: block; | |
position: absolute; | |
top: 50%; |
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 | |
// Exit if accessed directly | |
! defined( 'ABSPATH' ) && exit; | |
// Check if class already exists | |
if ( ! class_exists( 'OIR_Remove_Image_Sizes' ) ) : | |
final class OIR_Remove_Image_Sizes { |
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
(function(){ | |
var is_slrlounge_url = /https?:\/\/(www.|staging.)?slrlounge\.(dev|com)/; | |
if (null === is_slrlounge_url.exec(window.location)) { | |
alert("YES!"); | |
} else { | |
alert("NO."); | |
} |
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 | |
function get_random_attachment_id_from_post($post = 0) { | |
$post = get_post( $post ); | |
if ( ! preg_match_all( '/<img [^>]+>/', $post->post_content, $matches ) ) { | |
return 0; | |
} | |
$attachment_ids = array(); |
OlderNewer