Skip to content

Instantly share code, notes, and snippets.


Jérôme Tamarelle GromNaN

Block or report user

Report or block GromNaN

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
GromNaN / detect-utf8.php
Created Dec 1, 2011
How to detect UTF-8 string in PHP
View detect-utf8.php
function isUtf8($string)
return preg_match('%(?:'
. '[\xC2-\xDF][\x80-\xBF]' // non-overlong 2-byte
. '|\xE0[\xA0-\xBF][\x80-\xBF]' // excluding overlongs
. '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}' // straight 3-byte
. '|\xED[\x80-\x9F][\x80-\xBF]' // excluding surrogates
. '|\xF0[\x90-\xBF][\x80-\xBF]{2}' // planes 1-3
GromNaN /
Last active Jul 11, 2019
Split Composer Satis repositories into smaller packages
# 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
View conversion.html
<style type="text/css">
textarea {
width: 100%;
height: 300px;
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="conversion.js"></script>
GromNaN /
Last active Feb 11, 2017 — forked from andris9/
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



  • 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
GromNaN / GraphvizContainerCommand.php
Last active Jan 20, 2017
Graphviz Symfony container
View GraphvizContainerCommand.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 / e107-to-joomla.sql
Last active Aug 31, 2016
Users and Forum migration from e107 to Joomla+Kunena
View e107-to-joomla.sql
SET character_set_client = utf8mb4;
SET character_set_connection = utf8mb4;
CREATE DEFINER=`root`@`localhost` FUNCTION `HTML_UnEncode`(x VARCHAR(16383)) RETURNS varchar(16383) CHARSET utf8mb4
DECLARE TextString VARCHAR(16383);
GromNaN / rollbar-resolve-items.php
Created Mar 14, 2016
Rollbar : Find and resolve items using the API
View rollbar-resolve-items.php
$term = 'This resource is not routable';
$read_access_token = '<READ ACCESS TOKEN>';
$write_access_token = '<WRITE ACCESS TOKEN>';
$total = 0;
do {
View gist:9081b690c9fc9e41380e
autocrlf = input
fileMode = false
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
View main.js
$(document).ajaxComplete(function(event, XMLHttpRequest){
var link = XMLHttpRequest.getResponseHeader('x-debug-token-link');
if(link) {
$.get(link, function(data){
View 5_11_2013 École du tech lead: Conversation autour de la dette technique
É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
You can’t perform that action at this time.