Skip to content

Instantly share code, notes, and snippets.

View Tom32i's full-sized avatar

Thomas Jarrand Tom32i

View GitHub Profile
<?php
namespace Acme\Serializer\Normalizer;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer;
@Tom32i
Tom32i / afup-CFP-mean.js
Created May 30, 2023 12:34
Get mean notation on your AFUP CFP submission
(document.body.querySelectorAll('.star.is-selected').length/document.body.querySelectorAll('.star').length)*5;
@Tom32i
Tom32i / astuces_rando_velo.md
Created July 30, 2020 11:31
Astuces rando vélo

La rando

  • Faites vous plaisir, arrêtez vous quand vous êtes fatigués, ne forcez pas.
  • Restez ouverts à l'imprévu, ne planifiez pas trop : il y a des campings et des gares partout, des fois ça roule bien, dès fois y'a un super spot et on a envie de s'arrêter à 15h et de passer le reste de l'aprem dans la piscine. Vous finirez peut être une gare plus tôt ou une gare plus tard que ce que vous aviez prévu :)
  • Comptez entre 60 et 80km par jour suivant comment ça roule. Vous ferrez sans soucis entre 350 et 450km en 6 jours (si tu veux avoir une idée de quelle ville est envisageable depuis votre point de départ).

Le matos

  • Prenez un petit kit crevaison (ou éventuellement une chambre à air de rechange) histoire de pas être coincé en pleine cambrousse.
  • La bouffe se gère facilement au jour le jour, petit commerce, boulangerie, marchés ... pas un soucis.
  • Au moins 2 sacoches chacun et un tendeur pour ficeler ce qui depasse.
  • 1 tenue pour rouler / 1 tenue confort pour le soir suffisent, ne vous
@Tom32i
Tom32i / README.md
Last active June 23, 2020 21:04
Simple list hydrator for Symfony2

Simple list hydrator for #Syfmony2

Sample User repository method that return all user names in an array:

/**
 * Find user names
 *
 * @return array
 */

public function findAllNames()

@Tom32i
Tom32i / Key Bindings - User.json
Last active January 4, 2019 09:40
Sublime Text 3 Base configuration
[
{ "keys": ["super+)"], "command": "indent" },
{ "keys": ["super+("], "command": "unindent" }
]
@Tom32i
Tom32i / fields.html.twig
Last active March 6, 2018 18:23
A simple way of automatically render Add and Delete buttons to collections through form theming. You just need to implement the "addPrototype(form_id)" Javascript function. #Symfony2 #Form #Collection
{% extends "form_div_layout.html.twig" %}
{% block form_row %}
{% spaceless %}
<div>
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
@Tom32i
Tom32i / README.md
Last active August 17, 2017 12:27
I18n JS

Installation

npm install i18n-js

Usage

Import just translations.js once in your main file, then use I18n everywhere.

Curvytron events

Events are JSON arrays, sent through websocket connexion, following that format:

[name, data, callbackID]

Get client ID

[["whoami",null,0]]
<!DOCTYPE html>
<html>
<head>
<title>Okeanos Explorer 2016 Livestream</title>
<style>
body, * {
margin: 0;
padding: 0;
font-size: 0;
background: #000000;
@Tom32i
Tom32i / CFP.md
Last active February 15, 2016 20:01
CFP 2016