Skip to content

Instantly share code, notes, and snippets.

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

Mickaël Andrieu mickaelandrieu

🏠
Working from home
View GitHub Profile
@mickaelandrieu
mickaelandrieu / day1.md
Last active August 29, 2015 14:13
Hello!

Day 1 : Project start

Introduction

BackBee is an open source project built on top of Symfony Components and Doctrine 2.

This tutorial describe the creation of a blog with community features like the possibility for any visitor to create and suggest the publication of an article. This kind of site is very popular and very easy to build with BackBee CMS, for instance you should take a look at Medium.

@mickaelandrieu
mickaelandrieu / day3.md
Last active August 29, 2015 14:13
day3
SELECT table_name AS "Tables", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "$DB_NAME";
Day 3: the Content model
======================
In the last episods:
- [Day1: Setup and install BackBee](https://github.com/backbee/blogbee/blob/day1-doc/doc/day1.md)
- [Day2: Bootstrap of BlogBee project](https://github.com/backbee/blogbee/blob/day2-doc/doc/day2.md)
Introduction
---------------
@mickaelandrieu
mickaelandrieu / .htaccess
Created January 28, 2015 16:59
Apache configuration
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

PHP

  • Object Oriented Programming
  • Namespaces
  • Interfaces
  • Anonymous functions and closures
  • Abstract classes

HTTP

# /repository/ClassContent/Article.yml
article:
properties:
name: Article
description: |
"An article contains title, abstract, main image and a customizable body"
category: [article]
elements:
title:
type: BackBuilder\ClassContent\Element\text
@mickaelandrieu
mickaelandrieu / disable_asus_touchpads.md
Last active August 29, 2015 14:16
Disable ASUS touchpads

List your xorg inputs:

$ xinput --list

=> you will see 2 mouses

@mickaelandrieu
mickaelandrieu / RedirectToAdminZoneListener.php
Last active February 23, 2017 10:51
Redirect to another action, regarding to the role (Symfony)
<?php
namespace AppBundle\EventListener;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Routing\Router;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;