Skip to content

Instantly share code, notes, and snippets.

View jorgecc's full-sized avatar
🏠
Working from home

Jorge Castro jorgecc

🏠
Working from home
View GitHub Profile
@jorgecc
jorgecc / php.csv
Created January 28, 2023 16:20
php inspections
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 12 columns, instead of 8. in line 4.
_language,_groupPath,_shortName,_groupKey,_enabledByDefault,_level,_implementationClass,_key,_bundle,_unfair,_cleanupTool,_editorAttributes
PHP,PHP,PhpUndefinedGotoLabelInspection,inspection.php.group.undefined,true,WARNING,com.jetbrains.php.lang.inspections.PhpUndefinedGotoLabelInspection,inspection.php.undefined.goto.label.inspection.display.name,messages.PhpBundle,,,
PHP,PHP,PhpUndefinedVariableInspection,inspection.php.group.undefined,true,ERROR,com.jetbrains.php.lang.inspections.PhpUndefinedVariableInspection,inspection.php.undefined.variable.inspection.display.name,messages.PhpBundle,,,
PHP,PHP,PhpUndefinedMethodInspection,inspection.php.group.undefined,true,WARNING,com.jetbrains.php.lang.inspections.PhpUndefinedMethodInspection,inspection.php.undefined.method.inspection.display.name,messages.PhpBundle,,,
PHP,PHP,PhpUndefinedNamespaceInspection,inspection.php.group.undefined,true,WARNING,com.jetbrains.php.lang.inspections.PhpUndefinedNamespaceInspection,inspection.php.undefined.namespace.inspection.disp
@jorgecc
jorgecc / ApplicationPlugin.java
Created March 5, 2022 22:44
fix for phpunit_codecoverage_display
package cc.takacs.php_codeverage_display;
import cc.takacs.php_codeverage_display.toolbar.ToggleIconService;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ApplicationComponent;
import org.jetbrains.annotations.NotNull;
@jorgecc
jorgecc / todo.json
Last active January 27, 2021 11:20
todo.json
[
{"ID":1,"Name":"Item #1","Done":1},
{"ID":2,"Name":"Item #2","Done":1},
{"ID":3,"Name":"Item #3","Done":1},
{"ID":4,"Name":"Item #4","Done":1}
]
@jorgecc
jorgecc / example.php
Created December 13, 2020 01:57
example.php
<?php
$data=[[101, "ABC", "MX993767772", "04/12/2000", 1, "J176", 1],
[101, "ABC", "MX993767772", "04/12/2000", 1, "J108", 2],
[127918, "RMT", "MX993767772", "04/12/2000", 1, "J108", 2]];
$result=[];
foreach($data as $k=>$v) {
// find value
$found=false;
foreach($result as $k2=>$v2) {
@jorgecc
jorgecc / login.php
Created September 29, 2020 13:17
login.php
<?php
// requiere composer https://getcomposer.org/
// requiere instalar la libreria pdoone dentro de composer https://github.com/EFTEC/PdoOne
use eftec\PdoOne;
include __DIR__.'/vendor/autoload.php'
try {
$conn=new PdoOne('mysql','localhost','login_tutor','root','');
format algo length time
HEX adler32 8 4.6730041503906
RAW adler32 4 4.7018527984619
RAW fnv164 8 6.2000751495361
HEX fnv1a32 8 6.2048435211182
HEX fnv132 8 6.2098503112793
RAW fnv132 4 6.2119960784912
HEX fnv164 16 6.2189102172852
HEX fnv1a64 16 6.2229633331299
RAW fnv1a32 4 6.227970123291
Reference No Reference Speed of Reference %
0.06107497215271 0.10248017311096 40.403133309913
type time
json_encode array 23.508071899414
serialize array 20.003318786621 (better)
json_decode array 120.9020614624
unserialize array 39.196014404297
json_encode object stdclass 24.199485778809
serialize object stdclass 32.901763916016
json_decode object stdclass 127.10094451904
unserialize object stdclass 102.61535644531
json_encode object 24.39022064209
@jorgecc
jorgecc / blade_compile.php
Created May 8, 2020 21:54
bladeone vs twig
<ul>
<?php $__currentLoopData = $categories; $this->addLoop($__currentLoopData);$this->getFirstLoop();
foreach($__currentLoopData as $category): $loop = $this->incrementLoopIndices(); ?>
<li><?php echo \htmlentities($category, ENT_QUOTES, 'UTF-8', false); ?></li>
<?php endforeach; $this->popLoop(); $loop = $this->getFirstLoop(); ?>
</ul>
@jorgecc
jorgecc / twig_compile.php
Created May 8, 2020 21:53
bladeone_vs_twig
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;