Skip to content

Instantly share code, notes, and snippets.

View iamluc's full-sized avatar

Luc Vieillescazes iamluc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am iamluc on github.
  • I am iamluc (https://keybase.io/iamluc) on keybase.
  • I have a public key ASCdo587DxnqAsDONi8fSuV_qgKQZp_MOBk2IuppG__dnQo

To claim this, I am signing this object:

@iamluc
iamluc / lexer.php
Created December 1, 2015 08:23
Simple Lexer in PHP
<?php
class Lexer
{
protected static $tokens = [
'T_PHRASE' => '/\s*"(([^"\\\\]|\\\\\\\\|\\\\"|\\\\)+)"?(\s+|$)/',
'T_OR' => '/\s*(or)(\s+|$)/',
'T_AND' => '/\s*(and)(\s+|$)/',
'T_WILDCARD' => '/\s*(\*)/',
'T_WORD' => '/\s*([^ \t\r\n\v\f\*]+)(\s*|$)/',
@iamluc
iamluc / symfony_docker-compose.yml
Last active December 10, 2022 13:25
Exemple of a simple docker-compose file for Symfony project with official images
#
# to execute a command in the container:
# docker exec -it XXX_web_1 su www-data -c "php app/console"
#
web:
# container_name: sf
image: php:apache
ports:
- 8888:80