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
/** | |
* All flags are thankfuly taken from http://flagpedia.net/ | |
* Flag lovers should definitely check it out.. | |
* | |
* User can modify this list as per his/her need.. | |
* | |
* - Rahul K. Thakare | |
* INDIA | |
* [email protected] | |
* github.com/bantya |
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
var Country = { | |
countries: { | |
"AC": { | |
countryName: "ASCENSION ISLAND", | |
countryCode: "247", | |
currencyCode: "EURO" | |
}, | |
"AF": { | |
countryName: "AFGHANISTAN", | |
countryCode: "93", |
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
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |
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 | |
$headers = [ | |
'MIME-Version: 1.0', | |
'Content-Type: text/html; charset="UTF-8";', | |
'Content-Transfer-Encoding: 7bit', | |
'Content-Disposition: inline', | |
'Date: ' . date('r', $_SERVER['REQUEST_TIME']), | |
'Message-ID: <' . $_SERVER['REQUEST_TIME'] . md5($_SERVER['REQUEST_TIME']) . '@' . $_SERVER['SERVER_NAME'] . '>', | |
'From: ' . $from, |
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 | |
/** | |
* TimThumb by Ben Gillbanks and Mark Maunder | |
* Based on work done by Tim McDaniels and Darren Hoyt | |
* http://code.google.com/p/timthumb/ | |
* | |
* GNU General Public License, version 2 | |
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
* | |
* Examples and documentation available on the project homepage |
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
static function detect($path1, $path2, $colorPrecision = null, $gaussianBlur = false) | |
{ | |
$img1 = imagecreatefrompng($path1); | |
$img2 = imagecreatefrompng($path2); | |
$w1 = imagesx($img1); $h1 = imagesy($img1); | |
$w2 = imagesx($img2); $h2 = imagesy($img2); | |
# Stop early if the size of images such that images can not be part of each other | |
if (($w1 > $w2 && $h2 > $h1)) |
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 | |
echo <<<_END | |
<font face='Courier New' size='4'><pre> | |
<ul> | |
<b><u>PHP PICTURE PROCESSOR</u> | |
<form method='post' action='picproc.php' | |
enctype='multipart/form-data'> | |
UPLOAD : <input type='file' name='p' size='1'> | |
ACTION : <select name='a'> |
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 | |
namespace Dwarf; | |
class Path extends Object implements \IteratorAggregate, \Countable { | |
protected $path; | |
public function __construct( $path ) { | |
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
// http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/ | |
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)); | |
} else { | |
$r = hexdec(substr($hex,0,2)); |
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
var filename='http://path/to/your/cssfile.css?' + new Date().getTime(); | |
var fileref=document.createElement("link"); | |
fileref.setAttribute("rel", "stylesheet"); | |
fileref.setAttribute("type", "text/css"); | |
fileref.setAttribute("href", filename); | |
document.getElementsByTagName("head")[0].appendChild(fileref); |
OlderNewer