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 | |
/** | |
* Compare versions with alphabetical components. | |
* Usesversion_compare after having converted single chars to their decimal values. | |
* Needed because version_compare does not understand versions like '2.5.c'. | |
* | |
* @param string $a | |
* @param string $b | |
* @param string $op | |
*/ |
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 | |
/** | |
* Check if a file exists but is not dir | |
* | |
* @param file | |
* @return bool | |
*/ | |
function file_exists_strict($file) | |
{ | |
return file_exists($file) && !is_dir($file); |
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 | |
/** | |
* Check if a directory is empty (a directory with just '.svn' or '.git' is empty) | |
* | |
* @param string $dirname | |
* @return bool | |
*/ | |
function dir_is_empty($dirname) | |
{ | |
if (!is_dir($dirname)) return false; |
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 | |
/** | |
* Extract unique values of the specified key in a two dimensional array | |
* | |
* @param array $array | |
* @param mixed $key | |
* @return array | |
*/ | |
function array_unique_deep($array, $key) | |
{ |
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 | |
/** | |
* Search a string in array values | |
* | |
* @param string $needle | |
* @param array $haystack | |
* @param bool $match_all - return all instances | |
* @param bool $preg_mode - search in PCRE mode | |
* @return mixed|array | |
*/ |
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 | |
/** | |
* Generate a very simple image containing some text | |
* | |
* Basic usage: | |
* (new SimpleTextImage('Hello world!'))->render(); | |
* | |
* All functionalities: | |
* (new SimpleTextImage()) | |
* ->setText('Hello world!') |
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 | |
/** | |
* Write text on image with silkscreen font http://kottke.org/plus/type/silkscreen | |
* | |
* Usage: | |
* $img = imagecreatetruecolor(65, 15); | |
* $bg = imagecolorallocate($img, 0, 0, 0); | |
* $fg = imagecolorallocate($img, 255, 255, 255); | |
* | |
* silk::write($img, 5, 5, 'Hello world', $fg, 1, false, 0); |
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
/** | |
* TUMBLR downloader | |
* | |
* Usage: | |
* - enter the blog name: URL part before `.tumblr.com` | |
* - enter what you want to download: `posts` or `likes` | |
* - enter your OAuth public key (https://www.tumblr.com/settings/apps) | |
* - optionally enter the minimum id to retrieve (ignored if `[blog]-[mode].last` file exists) | |
* - if you have a small internet connection, set the queue size to 1 | |
* - you can ask the downloader to overwrite existing files |
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
[Code] | |
// mark installer for deletion if argument "-delete-installer" is present | |
procedure DeinitializeSetup(); | |
var i: integer; | |
begin | |
for i:= 0 to ParamCount do | |
begin | |
if ParamStr(i) = '-delete-installer' then | |
begin | |
RestartReplace(ExpandConstant('{srcexe}'), ''); |
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
#define SettingsFile "settings.xml" | |
[CustomMessages] | |
english.DeleteSettings=Delete settings file? | |
[Code] | |
// ask for delete config file during uninstall | |
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); | |
begin | |
case CurUninstallStep of |
OlderNewer