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
<? | |
/** | |
* returns the first true-valued value | |
* | |
* @param mixed $if | |
* @param mixed $or | |
* @return mixed | |
* | |
* @package Handframe/Tool/Function | |
* @author Mirco Babini <[email protected]> |
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
<? | |
/** | |
* rounds a float to the nearest on step-scale | |
* | |
* @param float $value value to round | |
* @param float $step step-scale, | |
* @return float rounded value | |
* | |
* @package Handframe/Tool/Function | |
* @author Mirco Babini <[email protected]> |
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
/** | |
* useful to create large lists from others on twitter | |
* | |
* @author Mirco Babini <[email protected]> | |
* @license http://creativecommons.org/licenses/by-nc/3.0/ | |
* | |
* @usage | |
* gimmeabeer (listid); | |
* gimmeabeer ([listid1, listid2, ..]); | |
*/ |
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
<? | |
/** | |
* Retro-support of get_called_class() | |
* @author laurence(at)sol1(dot)com(dot)au | |
*/ | |
if (!function_exists ('get_called_class')) | |
{ | |
function get_called_class ($bt = false, $l = 1) | |
{ | |
if (!$bt) $bt = debug_backtrace (); |
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
<? | |
require "vcard-extendible.php"; // https://github.com/nuovo/vCard-parser | |
class GCards extends vCard { | |
/** | |
* @return bool | |
*/ | |
public function hasTel () { | |
return (sizeof ($this->tel) > 0); | |
} | |
public function hasMail () { |
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
<? | |
// [..] | |
/** | |
* Hostname specific wp-config statement | |
* | |
* @author Mirco Babini <[email protected]> | |
* @uses hostname (): */ | |
if (!function_exists ('hostname')) { | |
function hostname () { return trim (php_uname ("n")); } } /* |
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
<? | |
/** | |
* @author _LameMind <[email protected]> | |
*/ | |
abstract class LinuxSystem { | |
/** | |
* @param string $question | |
* @param array $admittedValues | |
* @return mixed | |
*/ |
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
<? | |
/** | |
* @param string $olddomain | |
* @param string $newdomain | |
* @param string $infile | |
* @param string $outfile | |
* @return int|bool | |
*/ | |
function wp_sql_domain_changer ($olddomain, $newdomain, $infile = null, $outfile = null) { | |
$infile = ($infile === null) ? 'input.sql' : $infile; |
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
<? | |
$input = "input.java"; | |
$c = file_get_contents ($input); // get the mess | |
$c = str_replace ('(', " (", $c); // fill the space | |
$c = preg_replace ('#\s\s+\(#', " (", $c); // remove multiple spaces | |
file_put_contents ("output.java", $c); // spread the world | |
// one day you will regret it |
OlderNewer