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_action('wp_footer', 'wrap_jetpack_sharing', 18); | |
function wrap_jetpack_sharing() { | |
global $wp_scripts; | |
$a = $wp_scripts->get_data('sharing-js','after'); | |
$data = 'document.addEventListener( "DOMContentLoaded", function() { '; | |
$data .= implode("\n", $a); | |
$data .= ' }, false );'; | |
$script[] = $data; |
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 get_responsive_image_tag_for_attachment($attachment_id, $requested_size) { | |
$data = get_responsive_image_sizes_for_size($requested_size); | |
$srcset = []; | |
foreach($data as $image) { | |
$image_data = wp_get_attachment_image_src($attachment_id, $image); | |
if ($requested_size == $image) { | |
$src = $image_data[0]; | |
} | |
$srcset[] = $image_data[0].' '.$image_data[1].'w'; | |
} |
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
{ | |
"name": "laravel/laravel", | |
"description": "The Laravel Framework.", | |
"keywords": ["framework", "laravel"], | |
"license": "MIT", | |
"type": "project", | |
"require": { | |
"php": ">=5.5.9", | |
"laravel/framework": "5.2.*", | |
"lusitanian/oauth": "dev-master as 0.3", |
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
public function group_info($group_name,$fields=NULL){ | |
if ($group_name===NULL){ return (false); } | |
if (!$this->_bind){ return (false); } | |
if (stristr($group_name, '+')) { | |
$group_name=stripslashes($group_name); | |
} | |
$filter="(&(objectCategory=group)(name=".$this->ldap_slashes($group_name)."))"; | |
//echo ($filter."!!!<br>"); |
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 | |
/* | |
Plugin Name: Hello Taylor | |
Plugin URI: https://gist.github.com/lgladdy/9e1a7303c6a6bf43b9b1 | |
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in <strike>two</strike> words sung most famously by <strike>Louis Armstrong: Hello, Dolly.</strike>Taylor Swift. When activated you will randomly see a lyric from <strike><cite>Hello, Dolly</cite></strike><cite>Taylor Swift</cite> in the upper right of your admin screen on every page. | |
Author: Liam Gladdy (based on Hello Dolly by Matt Mullenweg) | |
Version: 1.1 | |
Author URI: http://www.twitter.com/lgladdy & http://ma.tt/ | |
*/ |
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/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php | |
+++ b/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php | |
@@ -841,6 +841,7 @@ function acf_extract_var( &$array, $key ) { | |
// vars | |
$r = null; | |
+ if (!is_array($array)) return false; | |
// check if exists | |
if( array_key_exists($key, $array) ) { |
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 | |
$hex = 'ff00ff'; | |
$rgb = hex2rgb($hex); | |
$xybri = rgbToXyBri($rgb); | |
echo $hex.' becomes x:'.$xybri['x'].', y: '.$xybri['y'].' and brightness: '.$xybri['bri']; | |
function rgbToXyBri($rgb) { | |
$r = $rgb['r']; | |
$g = $rgb['g']; |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
options: { | |
sourceMap: true, | |
sourceMapIncludeSources: true, | |
sourceMapIn: 'js/app.coffee.js.map' | |
}, |
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
/* =WordPress Core - Sassified. | |
-------------------------------------------------------------- */ | |
.alignnone { | |
margin: 5px 20px 20px 0; | |
} | |
.aligncenter, div.aligncenter { | |
display: block; | |
margin: 5px auto 5px auto; | |
} |
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 | |
/** | |
* Plugin Name: Grunt Sitemap Generator | |
* Plugin URI: http://www.github.com/lgladdy | |
* Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php | |
* Author: Liam Gladdy | |
* Author URI: http://gladdy.co.uk | |
* Version: 1.0 | |
*/ | |