Skip to content

Instantly share code, notes, and snippets.

View abbadon1334's full-sized avatar
⚙️
Aut inveniam viam aut faciam

Francesco Danti abbadon1334

⚙️
Aut inveniam viam aut faciam
View GitHub Profile
@abbadon1334
abbadon1334 / Sistema Valutazione Toscana (grouped).csv
Created September 26, 2023 07:59
Sistema Valutazione Toscana
Regione valore valutazione
Area Vasta Centro 14.617 -1
Ausl Centro 14.617 -1
Toscana 15.65 -1
Area Vasta Nord Ovest 15.883 -1
Ausl Nord Ovest 15.883 -1
Area Vasta Sud Est 18 -1
Ausl Sud Est 18 -1
I am a dev who code alone
And when I'm coding a github
At night or strolling through the repo
When the test begins to fails
I sometimes feel a little strange
A little anxious when can be a bug
Fear of the bug, fear of the bug
I have a constant fear that somethings always fails
Fear of the bug, fear of the bug
I have a phobia that someone's always blame
<?php
use atk4\core\AppScopeTrait;
use atk4\core\DIContainerTrait;
use atk4\core\FactoryTrait;
use atk4\core\InitializerTrait;
use atk4\core\TrackableTrait;
use atk4\ui\CRUD;
trait PluginTrait
@abbadon1334
abbadon1334 / UserGridCriteria.php
Created December 5, 2019 10:22
User Grid Criteria, an object to store filters and columns visibility
<?php
class UserGridCriteria extends \atk4\data\Model
{
public $table = "user_grid_criteria";
public $title_field = "name";
/**
* @var string
@abbadon1334
abbadon1334 / composer.json
Last active June 27, 2019 18:14
my actual composer.json for development with script for phpstan cs-fixer phpunit metrics coverage atk4
{
"name": "abbadon1334/nemesi",
"description": "description",
"type": "project",
"license": "MIT",
"authors": [
{
"name": "Francesco Danti",
"email": "fdanti@gmail.com"
}
@abbadon1334
abbadon1334 / benchmark_class_exists_and_reflection.php
Created May 12, 2019 07:36
Testing check for class existence and if caching class name is relevant in function of performance check over 10000000 iterations just to minimize errors and first loading of not already loaded existent class Results on PHP 7.3.5 shows that is not needed. https://github.com/atk4/ui/pull/702
<?php
/*
Testing check for class existence and if caching class name is relevant in function of performance
check over 10000000 iterations just to minimize errors and first loading of not already loaded existent class
Results on PHP 7.3.5 below shows that is not needed :)
BENCHMARK CASE CACHE REFLECTION AVG Time(s) Max Time(s) Tot Time(s) StdDev Time AVG MEM(b)
\Profiler N N 0.00000069 0.00246596 6.92156839 0.00000104 53.68750880
@abbadon1334
abbadon1334 / findKmInRadiusWithAtk4.php
Created May 10, 2019 10:51
Given a MaxRadiusInKm, filter the reference of a model and get All records in the request radius by longitude and latitude.
$radiusMaxInKm = (int) $filterRequest['km'][0] ?? $filterRequest['km'] ?? 0;
$IDCitta = (int) $value;
$mCitta = new Citta($this->app->db);
$mCitta->tryLoad($IDCitta);
$earthRadiusKilometers = 6378.140;
$latitude = $mCitta->get('Latitude');
$longitude = $mCitta->get('Longitude');
@abbadon1334
abbadon1334 / BackgroundProcess.php
Last active March 2, 2019 07:04 — forked from jakzal/BackgroundProcess.php
Starting a PHP built in server in phpunit tests
<?php
namespace Zalas\Test;
use Symfony\Component\Process\Process;
trait BackgroundProcess
{
/**
* @var Process
<?php
include '../common.php';
class MyApp extends \atk4\ui\App
{
public $db;
public $auth;
@abbadon1334
abbadon1334 / benchmark_suppression.php
Created February 21, 2019 11:58
Suppression bench @ vs isset
<?php
/**
* Copyright (c) 2019.
*
* Francesco "Abbadon1334" Danti <fdanti@gmail.com>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,