Skip to content

Instantly share code, notes, and snippets.


Beno!t POLASZEK bpolaszek

View GitHub Profile
bpolaszek / select-countries.html
Created Jul 17, 2020
Vanilla JS snippet to generate a SELECT country list from an API.
View select-countries.html
<select id="country" name="country">
(async () => {
const response = await fetch(';name');
const countries = await response.json();
const select = document.getElementById('country');
for (const country of countries) {
const option = document.createElement('option');
bpolaszek / bootstrap.php
Last active Jun 26, 2020
Symfony shortcuts for Pest
View bootstrap.php
# tests/bootstrap.php
namespace App\Test;
use App\Kernel;
use Doctrine\DBAL\DriverManager;
use Doctrine\Migrations\MigratorConfiguration;
bpolaszek / debug-breakpoint.html
Created Jan 8, 2020
HTML snippet for breakpoint debugging / Bootstrap 4
View debug-breakpoint.html
<div class="d-inline-block d-sm-none">XS</div>
<div class="d-none d-sm-inline-block d-md-none">SM</div>
<div class="d-none d-md-inline-block d-lg-none">MD</div>
<div class="d-none d-lg-inline-block d-xl-none">LG</div>
<div class="d-none d-xl-inline-block">XL</div>
bpolaszek / API-Platform New Documentation
Last active Oct 7, 2019
New documentation hierarchy suggestion for Api-Platform 2.x.
View API-Platform New Documentation

API-Platform Documentation

Getting started

1. Introduction

Introduction, concepts, features, other resources

bpolaszek / check-environment-variables.php
Last active Nov 5, 2018
Check that all environment variables defined in your .env.dist are properly set.
View check-environment-variables.php
#!/usr/bin/env php
* Checks that all environment variables are set before deploying.
* @author Beno!t POLASZEK - 2018
* @link
bpolaszek / CleanAssociationsTrait.php
Created Sep 24, 2015
Doctrine : Fix ManyToOne relationships when the value in database is 0 instead of NULL
View CleanAssociationsTrait.php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Event\LifecycleEventArgs;
* Trait CleanAssociationsTrait
* This trait is intended to fix the Doctrine ManyToOne relationships when the stored value in database is a 0 instead of NULL.
* Sometimes you plug Doctrine on an existing database without foreign key support.
You can’t perform that action at this time.