Skip to content

Instantly share code, notes, and snippets.

@Xorder664
Xorder664 / emacs-essential-keybindings.md
Last active October 1, 2024 13:27 — forked from ulysses4ever/emacs-essential-keybindings.md
Emacs: основные сочетания клавиш

Обозначения:

  • C — клавиша Control, обычно настроена на Ctrl.
  • M — клавиша Meta, обычно настроена на Alt.

Emacs: Общее

  • M-x ввести команду
  • C-x C-c закрыть Emacs
  • C-g прекратить текущую операцию
<?php
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Color;
//создать лист и задать отступы
$oSpreadsheet = new Spreadsheet();
$sheet = $oSpreadsheet->getActiveSheet();
$sheet->getPageMargins()
@Xorder664
Xorder664 / CountryRepository.php
Created September 5, 2023 09:17 — forked from adamsafr/CountryRepository.php
Doctrine: Union with JOIN example
<?php
namespace AppBundle\Repository;
use AppBundle\Entity\Country;
use AppBundle\Entity\CountryTranslation;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\QueryBuilder;
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ChangeTable extends Migration
{
/**
* Run the migrations.
@Xorder664
Xorder664 / laravel_conditional_index_migration.php
Created May 31, 2023 09:45 — forked from Razoxane/laravel_conditional_index_migration.php
Laravel - Create Index If Not Exists / Drop Index If Exists
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LaravelConditionalIndexMigration extends Migration
{
/**
* Run the migrations.
@Xorder664
Xorder664 / StrategyFilter.php
Created May 25, 2023 08:45 — forked from byhoratiss/StrategyFilter.php
Api Platform multiple SearchFilter strategies for a property
<?php
namespace App\Filter;
use ApiPlatform\Core\Api\IriConverterInterface;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryBuilderHelper;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Core\Exception\InvalidArgumentException;
use Doctrine\Common\Persistence\ManagerRegistry;
@Xorder664
Xorder664 / ContractController.php
Created May 25, 2023 08:39 — forked from webdevilopers/ContractController.php
Inject Entity and Repository into Service with Symfony2
<?php
use Plusquam\Bundle\ContractBundle\Service\Invoice;
class ContractAdminController extends Controller
{
/**
* Invoice action
*
* @return Response
@Xorder664
Xorder664 / SuperAdminGroupContextBuilder.php
Created March 23, 2023 08:46 — forked from zspine/SuperAdminGroupContextBuilder.php
API Platform custom ContextBuilder and Denormalizer
<?php
namespace App\Serializer\ApiPlatform;
use ApiPlatform\Core\Serializer\SerializerContextBuilderInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use App\Entity\User;