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 | |
/** | |
* imagettftext_in_lines | |
* | |
* @author JoseRobinson.com | |
* @link https://gist.github.com/jrobinsonc/699ea6fadd7369146574 | |
* @version 201502131102 | |
* @param $image An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(). | |
* @param $font_size The font size. Depending on your version of GD, this should be specified as the pixel size (GD1) or point size (GD2). |
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 | |
/** | |
* get_thumb_tag | |
* | |
* @author JoseRobinson.com | |
* @link https://gist.github.com/jrobinsonc/3959a3c40138fdb701c8 | |
* @version 201506211936 | |
* @param int $post_id | |
* @param mixed $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
function hex2rgb($hex) | |
{ | |
$hex = str_replace("#", "", $hex); | |
if(strlen($hex) === 3) | |
{ | |
$r = hexdec(substr($hex,0,1).substr($hex,0,1)); | |
$g = hexdec(substr($hex,1,1).substr($hex,1,1)); | |
$b = hexdec(substr($hex,2,1).substr($hex,2,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
$breakpoints: ( | |
"sm": ( min-width: 640px ), | |
"md": ( min-width: 768px ), | |
"lg": ( min-width: 1024px ), | |
"xl": ( min-width: 1280px ) | |
); | |
// Usage | |
// @include breakpoint(xs) { ... } |
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 | |
/** | |
* is_parent | |
* | |
* @author JoseRobinson.com | |
* @link https://gist.github.com/jrobinsonc/e6098d90453d58f31793 | |
* @param int $pid | |
* @return bool | |
*/ |
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
angular.module('mymodule').filter('ucwords', function() { | |
return function(input,arg) { | |
return input.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); | |
}; | |
}); |
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
String.prototype.repeat = function( num ) | |
{ | |
return new Array( num + 1 ).join( this ); | |
} | |
alert( "string to repeat\n".repeat( 4 ) ); |
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 | |
/** | |
* Execute PHP from widgets. | |
*/ | |
add_filter('widget_text', function ($html){ | |
if(strpos($html, "<"."?php") !== false) | |
{ | |
ob_start(); |
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 | |
/** | |
* create_thumb | |
* | |
* @author JoseRobinson.com | |
* @link https://gist.github.com/jrobinsonc/b40c99a4d688f8a2d554 | |
* @param string $file_src_path | |
* @param int $width | |
* @param int $height |