Skip to content

Instantly share code, notes, and snippets.

@mrLexx
mrLexx / noinspection.php
Last active December 23, 2024 13:19 — forked from gskema/noinspection.php
PhpStorm @noinspection list of all tags
<?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
@mrLexx
mrLexx / phpstorm_evaluation_license_reset.md
Created April 25, 2024 08:13
PhpStorm reset evaluation license/period

PhpStorm reset evaluation license/period

Make sure to export/import your settings through File -> Manage IDE settings before/after

Windows 10

  1. Close PHPStorm
  2. Run these in PowerShell to remove PhpStorm configuration:
Remove-Item '.\AppData\Local\Jetbrains\PhpStorm*'
Remove-Item '.\AppData\Roaming\Jetbrains\PhpStorm*'
@mrLexx
mrLexx / git-reset-author.sh
Created August 13, 2023 18:36 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
<?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;
@mrLexx
mrLexx / rearct-native-app-in-wsl2.md
Created April 20, 2022 07:29 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2

Detect google and yandex search bots (crawl, spider)

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
#!/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