View clear_requests.php
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 | |
// require | |
// | |
// "Portable UTF-8" -> https://packagist.org/packages/voku/portable-utf8 | |
// "HTMLPurifier" -> https://packagist.org/packages/ezyang/htmlpurifier | |
use voku\helper\UTF8; | |
// init HTMLPurifier (TODO: move this e.g. to a WrapperClass) |
View gist:d958041e7b1c19356e721de1eda1e6f8
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
# Apache Server Configs v5.1.0 | MIT License | |
# https://github.com/h5bp/server-configs-apache | |
# (!) Using `.htaccess` files slows down Apache, therefore, if you have | |
# access to the main server configuration file (which is usually | |
# called `httpd.conf`), you should add this logic there. | |
# | |
# https://httpd.apache.org/docs/current/howto/htaccess.html | |
# ###################################################################### |
View DotNotation.php
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 | |
/** | |
* Dot notation for access multidimensional arrays. | |
* | |
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]); | |
* | |
* $value = $dn->get('bar.baz.foo'); // $value == true | |
* | |
* $dn->set('bar.baz.foo', false); // ['foo'=>false] | |
* |
View disallow_ssh_exec.php
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
#!/usr/bin/php | |
<?php | |
$output = []; | |
exec('[ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "remote" || echo "local"', $output); | |
if ($output[0] != 'local') { | |
echo "Run this script only on your computer!\n\n"; | |
// @codingStandardsIgnoreStart | |
exit(1); | |
// @codingS |
View VdmgReturnIntValueCheckSniff.php
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 | |
use PHP_CodeSniffer\Files\File; | |
use PHP_CodeSniffer\Sniffs\Sniff; | |
final class VdmgReturnIntValueCheckSniff implements Sniff { | |
/** | |
* String representation of error. | |
* |
View VdmgNoDuplicateNegativIfConditionRule.php
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 | |
declare(strict_types=1); | |
namespace vdmg\App\scripts\githooks\StandardVdmg\PHPStan; | |
use PhpParser\Node; | |
use PHPStan\Analyser\Scope; | |
use PHPStan\Rules\Rule; |
View global_js_error_handling.html
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
<script type="text/javascript"> | |
var one_error_reported_via_onerror = false; | |
var globalErrorReportHelper = function(msg, url, line, col, error) { | |
// fallback for e.g.: IE | |
if ( | |
!error | |
&& | |
typeof Error === "function" |
View StringLib.php
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 | |
/** | |
* Class StringLib | |
* | |
* @see https://github.com/voku/portable-utf8 | |
*/ | |
class StringLib { | |
/** |
View validation_date.php
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 | |
/** | |
* check for date-format | |
* | |
* @param string $date valid is only "YYYY-MM-DD" | |
* | |
* @return bool | |
*/ | |
function checkDateFormat($date) |
View code_check_git_hook.php
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
#!/usr/bin/php | |
<?php | |
/** | |
* // | |
* // add something like this in your "composer post-update-cmd && post-install-cmd" | |
* // | |
* echo "\n\n"; | |
* echo "Run force \"code_check_git_hook.php\" as pre-commit-hook ..."; | |
* $force_pre_commit_hook_cmd = 'ln -sf YOUR_PATH_TO_CODE_CHECK_SCRIPTS/code_check_git_hook.php YOUR_PATH_TO_PROJECT_ROOT/.git/hooks/pre-commit'; |
NewerOlder