function detectSearchBot($ip, $agent, &$hostname)
{
$hostname = $ip;
// check HTTP_USER_AGENT what not to touch gethostbyaddr in vain
if (preg_match('/(?:google|yandex)bot/iu', $agent)) {
// success - return host, fail - return ip or 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
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
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 | |
declare(strict_types=1); | |
use Rector\Config\RectorConfig; | |
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; | |
use Rector\Php71\Rector\FuncCall\CountOnNullRector; | |
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; | |
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; | |
use Rector\Php80\Rector\Class_\StringableForToStringRector; |
Make sure to export/import your settings through File -> Manage IDE settings
before/after
- Close PHPStorm
- Run these in PowerShell to remove PhpStorm configuration:
Remove-Item '.\AppData\Local\Jetbrains\PhpStorm*'
Remove-Item '.\AppData\Roaming\Jetbrains\PhpStorm*'
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 | |
// https://www.jetbrains.com/help/inspectopedia/PHP.html | |
/** @noinspection ? */ | |
// PhpObjectFieldsAreOnlyWrittenInspection Local object is used only for writing properties | |
// PhpUndefinedGotoLabelInspection Undefined goto label | |
// PhpUndefinedVariableInspection Undefined variable | |
// PhpUndefinedMethodInspection Undefined method |