Skip to content

Instantly share code, notes, and snippets.

View GromNaN's full-sized avatar
🚲
☀️

Jérôme Tamarelle GromNaN

🚲
☀️
View GitHub Profile
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'
École du tech lead: Conversation autour de la dette technique
----
TLDR de Cyrille Deruel @CyrilleDeruel
Les 3 phrases sur la dettes
- Pas dépuration de la dette sans refactoring et pas de refactoring sans tests automatisés
- Normalement tu n'as pas besoin d'aller chercher la dette, c'est la dette qui te trouve
- Ta dette tu la gères tous les jours
@GromNaN
GromNaN / main.js
Last active December 29, 2015 12:59 — forked from anonymous/main.js
$(document).ajaxComplete(function(event, XMLHttpRequest){
var link = XMLHttpRequest.getResponseHeader('x-debug-token-link');
if(link) {
$.get(link, function(data){
$('.sf-toolbarreset').remove();
$('body').append(data);
});
}
@GromNaN
GromNaN / apcclearcache.php
Created April 2, 2014 11:49
Clear APC on deploy
<?php
/**
* Clear APC opcode and user caches on deploy
* per directory and prefix.
*
* Store this file in your default APACHE/NGINX root (/home/www/apcclearcache.php)
* Call this file on deployment:
*
* php /home/www/apcclearcache.php <release_dir> <user_cache_prefix>
@GromNaN
GromNaN / base.twig
Last active August 29, 2015 13:58
Twig issue #1378
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
{% block head %}
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
{% endblock %}
</head>
<body>
{% block header %}{% endblock %}
@GromNaN
GromNaN / gist:10878088
Created April 16, 2014 13:46
Prophecy vs PHPUnit MockObjects error messages

With Prophecy

jtamarelle@ox-dev-php ~/f/lexpress> phpunit tests/Routing/Matcher/ChainMatcherTest.php
PHPUnit 3.7.31 by Sebastian Bergmann.

Configuration read from /space/home/jtamarelle/front/lexpress/phpunit.xml.dist

.E...
<?php
function parseJsonx(\DOMNode $node)
{
switch ($node->nodeName)
{
case 'json:object':
$data = new stdClass();
foreach ($node->childNodes as $childNode) {
if ($childNode instanceof \DOMElement
@GromNaN
GromNaN / .htaccess
Created January 6, 2015 16:42
Bridge Wordpress & Symfony
<IfModule mod_rewrite.c>
RewriteEngine On
# Symfony2 URLs begins with app or admin/dashboard
RewriteRule ^app/ app.php [QSA,L]
RewriteRule ^admin/dashboard app.php [QSA,L]
# Others requests are redirected to Wordpress
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
@GromNaN
GromNaN / build.sh
Last active July 11, 2019 16:08
Split Composer Satis repositories into smaller packages
#!/bin/sh
# For each sub-package, run the Satis build command.
php bin/satis build repositories-mirrors.json ./web/mirrors
php bin/satis build repositories-pear.json ./web/pear
php bin/satis build repositoriesp-rojects.json ./web/projects
# Merge all the package files.
php web/packages.php > web/packages.json
[core]
autocrlf = input
fileMode = false
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto