Skip to content

Instantly share code, notes, and snippets.

View matthieuauger's full-sized avatar

Matthieu Auger matthieuauger

View GitHub Profile

Understanding Docker

Understanding the basic

1. Images

The first minimal thing to understand are images. Images provide you some utilities, there are images for mysql, php, nginx and almost everything.

Here, we will use the official PHP image.

// Credits: Adam's answer in http://stackoverflow.com/a/20786262/69362
// Paste this in browser's console
var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope');
$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeStart to '+toState.to+'- fired when the transition begins. toState,toParams : \n',toState, toParams);
});
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeError - fired when an error occurs during transition.');
# routing.yml
app_fr:
resource: routing_fr.yml
condition: "request.attributes.get('_locale') == 'fr'"
app_en:
resource: routing_en.yml
condition: "request.attributes.get('_locale') == 'en'"
@matthieuauger
matthieuauger / link.py
Last active August 29, 2015 14:18
Link articles in "code-civil"
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{
@matthieuauger
matthieuauger / phpmyadmin-nginx
Created February 15, 2014 12:14
Nginx & PHP-FPM configuration for phpMyAdmin
server {
listen 80;
server_name phpmyadmin.yourdomain.com;
access_log /var/log/nginx/phpmyadmin_access.log;
error_log /var/log/nginx/phpmyadmin_error.log;
root /usr/share/phpmyadmin;
index index.php;