Skip to content

Instantly share code, notes, and snippets.

View GromNaN's full-sized avatar
🚲
☀️

Jérôme Tamarelle GromNaN

🚲
☀️
View GitHub Profile
@GromNaN
GromNaN / errors.php
Created November 21, 2012 09:31
Jolies erreurs PHP
<?php
function handler ($errno, $errstr, $errfile, $errline)
{
echo "<div style=\"background: #ffe13b; color: black; position: fixed; bottom: 0; width: 100%; text-align: center; font-size: 13px; padding: 5px; box-shadow: 0 0 5px black;\">Erreur $errno $errstr in $errfile:$errline
</div>";
}
set_error_handler('handler');
@GromNaN
GromNaN / Symfony1GuardPasswordEncoder.php
Created April 5, 2013 14:22
Implements symfony1 password encoding for Symfony2 security component
<?php
namespace Security\Encoder;
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
/**
* Implements symfony1 password encoding
*
* @see PluginsfGuardUser::checkPasswordByGuard()
#!/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);
});
}
[core]
autocrlf = input
fileMode = false
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
@GromNaN
GromNaN / rollbar-resolve-items.php
Created March 14, 2016 12:27
Rollbar : Find and resolve items using the API
<?php
$term = 'This resource is not routable';
$read_access_token = '<READ ACCESS TOKEN>';
$write_access_token = '<WRITE ACCESS TOKEN>';
$total = 0;
do {
@GromNaN
GromNaN / e107-to-joomla.sql
Last active August 31, 2016 23:11
Users and Forum migration from e107 to Joomla+Kunena
SET character_set_client = utf8mb4;
SET character_set_connection = utf8mb4;
DELIMITER $$
DROP FUNCTION IF EXISTS HTML_UnEncode$$
CREATE DEFINER=`root`@`localhost` FUNCTION `HTML_UnEncode`(x VARCHAR(16383)) RETURNS varchar(16383) CHARSET utf8mb4
BEGIN
DECLARE TextString VARCHAR(16383);
@GromNaN
GromNaN / GraphvizContainerCommand.php
Last active January 20, 2017 21:27
Graphviz Symfony container
<?php
namespace AppBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@GromNaN
GromNaN / README.md
Last active February 11, 2017 19:17 — forked from andris9/README.md
Extremely simple HTTP proxy for changing Host: header Useful when proxying requests to virtual hosts that require Host: header to be set.

Setup reverse tunnel

Run the following in your client machine

ssh -R EXPOSED_PORT:localhost:SERVICE_PORT USER@HOST

Where

  • EXPOSED_PORT is the port exposed to the internet in the proxy server
  • SERVICE_PORT is the port your application is listening in your machine