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 | |
/********************************************************************* | |
* By: Anjan @ Nov 09, 2015 12:16 PM | |
********************************************************************* | |
* Generate a CSV file and send output directly to browser | |
* | |
* This example shows the use of php output stream to perform some | |
* file operation directly to browser itself | |
*********************************************************************/ |
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 | |
/** | |
* Converts a time difference in seconds to human readable format. | |
* | |
* This function takes a time difference in seconds and converts it into human readable format | |
* by breaking the difference into time units like year, month, day, hour, minute and seconds. | |
* Example: [4820] => [1 hour 20 minutes 20 seconds]. The difference is always considered a | |
* positive number or 0. | |
* |
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 array value. | |
* | |
* It takes the array and a key name or a key path to access element in single or | |
* multi-dimensional array. If value is not found, default value is returned. | |
* | |
* @param array $array The array to conduct the search on | |
* @param string $key The Key name or key path (a/b/c/d) |
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
/** | |
* Clearfix using overflow. This will present scrollbars through, | |
* if the cobtainer has fixed height but content exceeds the height | |
*/ | |
.clearfix { | |
overflow: 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
/** | |
* Vertical alignment inside a parent container with fixd height. | |
* Will not work without fixed height. Of course goes without saying | |
* that browser must support css3 transform. | |
* | |
* see: http://caniuse.com/#search=transform | |
*/ | |
.valign-top { |
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 Vimeo video id from url | |
* | |
* Supported url formats - | |
* | |
* https://vimeo.com/11111111 | |
* http://vimeo.com/11111111 |
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 | |
/** | |
* Gets the thumbnail url for a vimeo video using the video id. This only works for public videos. | |
* | |
* @param string $id The video id. | |
* @param string $thumbType Thumbnail image size. supported sizes: small, medium (default) and large. | |
* | |
* @return string|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
/** | |
* Is the given string a valid RGBA color? | |
* | |
* @param colorString | |
* | |
* @returns {boolean} | |
*/ | |
function isValidRgbaColorFormat(colorString) { |
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 Valid RGBA color? | |
* | |
* @param $colorString | |
* | |
* @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
^rgba\(([0]*[0-9]{1,2}|[1][0-9]{2}|[2][0-4][0-9]|[2][5][0-5])\s*,\s*([0]*[0-9]{1,2}|[1][0-9]{2}|[2][0-4][0-9]|[2][5][0-5])\s*,\s*([0]*[0-9]{1,2}|[1][0-9]{2}|[2][0-4][0-9]|[2][5][0-5])\s*,\s*([0-9]*\.?[0-9]+)\)$ |
OlderNewer