Skip to content

Instantly share code, notes, and snippets.

View BigZ's full-sized avatar
🏠
Working from home

Romain Richard BigZ

🏠
Working from home
  • Guns for hire !
  • Worldwide
View GitHub Profile
@BigZ
BigZ / ExceptionController.php
Created July 23, 2018 00:29
An exception controller for rest api in symfony 4 using fostRestBundle
<?php
// src/Controller/ExceptionController.php
namespace App\Controller;
use FOS\RestBundle\Util\ExceptionValueMap;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
@BigZ
BigZ / match.c
Created September 10, 2017 16:18
match in C
#include <stdlib.h>
#include <stdio.h>
int match(char *str1, char *str2)
{
int i, j;
// on va jusqu'au bout de la deuxieme chaine
for (i = 0, j = 0; str2[j] != '\0'; i++, j++) {
// si la premiere chaine est finie avant la deuxieme c'est dead