Skip to content

Instantly share code, notes, and snippets.

View gdarquie's full-sized avatar

Gaétan gdarquie

View GitHub Profile
@gdarquie
gdarquie / Doctrine RAW SQL
Created January 30, 2020 10:00
Example of raw SQL Doctrine
$sql = 'SELECT * FROM fragment LIMIT 10';
$stmt = $this->getEntityManager()->getConnection()->prepare($sql);
$stmt->execute();
return $stmt->fetchAll();
public function findAllDistinctFragments(int $limit)
{
$sql = "SELECT DISTINCT ON (f.code) * FROM fragment f ORDER BY f.code, f.created_at DESC ";
$rsm = new ResultSetMappingBuilder($this->getEntityManager());
$rsm->addRootEntityFromClassMetadata(Fragment::class, 'f');
$query = $this->getEntityManager()->createNativeQuery($sql, $rsm);
return $query->getResult();
@gdarquie
gdarquie / gist:b8c2dcfb2fc357b693ef302ced665f94
Last active April 23, 2025 18:36
Configuration Yubi Key - My notes
```
fido2-token -L
fido2-token -S /dev/hidraw5
ssh-keygen -t ed25519-sk -O resident -O application=ssh:github
fido2-token -L -r /dev/hidraw5
```
Modifier la config ssh depuis .ssh <code>vim config</code> En remplaçant USER par le nom de l'utilisateur linux qui utilisera la clef. Remplacer "id_ed25519_sk_rk_github" par le nom du fichier de clef privée qui devra être présenté