Skip to content

Instantly share code, notes, and snippets.

View Raphhh's full-sized avatar

Raphaël Lefebvre Raphhh

View GitHub Profile

Serveurs: . Linux . Putty . Apache . Nginx . Php . Mysql . Varnish . Vagrant puppet chef . Wamp

@Raphhh
Raphhh / create_project.sh
Last active August 29, 2015 14:06
PHP Lib Bootstrap script
#!/bin/sh
working_directory='./'
bootstrap_name='raphhh/php-lib-bootstrap'
bootstrap_version='@stable'
echo 'PHP Lib Bootstrap Generator'
echo '';
echo 'Enter your project name (<vendor>/<name>):'
@Raphhh
Raphhh / chess- coding-challenge.md
Last active August 29, 2015 14:06
Chess coding challenge

#Chess coding challenge

Le challenge réside dans la conceptualisation des algorithmes au niveau de l'architecture d'un code. L'idée n'est donc pas d'atteindre une performence dans le code, mais une écriture lisible, réutilisable, et emprunte de bonnes pratiques type SOLID.

Règles

Le code doit être testé et pushé sur un repo git public.

Etape 1: déplacements basiques

@Raphhh
Raphhh / readme-php-app
Last active August 29, 2015 14:07
readme-php-app
# PHP web app
## Main resources
website
code base repository
documentation
bug tracking
ci servers
monitoring
analytics
@Raphhh
Raphhh / php-lib-check-list.md
Last active August 29, 2015 14:07
PHP lib check list

PHP lib check list

Git

  1. .gitignore is versionned.
  2. .gitignore does not contain any IDE or system exclusions.

Files format

  1. Files are encoded in UTF-8 without BOM (PSR-1).
  2. End of lines are LF (PSR-2).
@Raphhh
Raphhh / pre-commit
Created December 7, 2015 12:33
Git pre-commit hook for PHP project
#!/bin/sh
# running the tests
./bin/test
echo ""
STATUS_CODE=$?
exit $STATUS_CODE
@Raphhh
Raphhh / CallableReflection.php
Last active December 20, 2015 22:18
PHP Callable Reflection: You can reflect a callback and know its type.
<?php
use TRex\Reflection\CallableReflection;
//examples
$closure = function(){};
$reflect = new CallableReflection($closure);
var_dump($reflect->getType()===CallableReflection::CLOSURE_TYPE);
var_dump($reflect->getFunctionName()==='');
var_dump($reflect->getClosure()===$closure);
var_dump($reflect->getClassName()==='');
@Raphhh
Raphhh / PHPStorm-code-template.md
Last active January 28, 2016 08:53
Templates for getter and setter in PHPStorm

#PHP getter method

/**
 * Getter of $${PARAM_NAME}
 *
 * @return ${TYPE_HINT}
 */
#if (${TYPE_HINT} == "bool" || ${TYPE_HINT} == "boolean")
public ${STATIC} function ${PARAM_NAME}()
@Raphhh
Raphhh / .bash_aliases
Last active February 16, 2016 13:53
set some aliases on linux
alias xphp='php -dxdebug.remote_enable=1 -dxdebug.remote_autostart=1'
alias dumpath='echo $PATH | tr ":" "\n"'
alias adduserpath='echo 'PATH="$1:$PATH"' >> ~/.profile'
@Raphhh
Raphhh / .gitconfig
Last active March 10, 2016 11:29
.gitconfig
[user]
name = Raphaël Lefebvre
email = raphael@raphaellefebvre.be
[core]
excludesfile = c:/Users/Raphaël/.gitignore_global
autocrlf = input
[ui]
color = auto
[grep]
extendedRegexp = true