Skip to content

Instantly share code, notes, and snippets.

View VincentChalnot's full-sized avatar
🐹
Working

Vincent Chalnot VincentChalnot

🐹
Working
View GitHub Profile
@bjo3rnf
bjo3rnf / EntityHiddenType.php
Last active November 19, 2021 17:19
Hidden field for Symfony2 entities
<?php
namespace Dpn\ToolsBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Dpn\ToolsBundle\Form\DataTransformer\EntityToIdTransformer;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\Common\Persistence\ObjectManager;

Unary operators

(and the oddities of number evaluation in JavaScript)

Type conversion, typecasting, and coercion are different ways of, implicitly or explicitly, changing an entity of one data type into another. [--wikipedia][wikipedia]


Unary operators, or "typeof +'foo' === huh?"

@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active June 26, 2024 09:36 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@MightyPork
MightyPork / usb_hid_keys.h
Last active July 5, 2024 22:07
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
<?php
// see https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata
namespace PHPSTORM_META {
override(\Doctrine\ORM\EntityManager::find(0), map([
'' => '@',
]));
override(\Interop\Container\ContainerInterface::get(0), map([
'' => '@',
@MilesTEG1
MilesTEG1 / volume_sur_ssd_mvne_dans_NAS_Synology.md
Last active June 18, 2024 03:12
Utiliser un SSD MVNe dans un NAS Synology en tant que volume et pas en tant que cache

Utiliser un SSD MVNe dans un NAS Synology en tant que volume et pas en tant que cache

Objectif final :
Déplacer le dossier docker, et le paquet Docker sur le volume SSD NVMe pour gagner en fluidité. Voir §-III. à la fin de ce GIST.

Note :
Les commandes suivantes sont pour la plupart à lancer en root dans un terminal, pensez à faire un : sudo -i