Skip to content

Instantly share code, notes, and snippets.

View B-Galati's full-sized avatar
😁

Benoit GALATI B-Galati

😁
View GitHub Profile
@B-Galati
B-Galati / merge.sh
Last active April 10, 2017 23:19
recursively merge some branches
#!/usr/bin/env bash
set -x;
BRANCHES=(release/branch1 release/branch2 release/branch3 master);
FIRST=${BRANCHES[0]};
for B in ${BRANCHES[@]:1};
do
git fetch;
git checkout "$B";
git reset --hard "origin/$B";
FROM wernight/phantomjs:latest
USER root
WORKDIR /
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git
RUN git clone https://github.com/acdha/phantomjs-mixed-content-scan.git /opt/mixed-content-scanner/ \
<?php
namespace Manwin\YouPorn\WebFrontBundle\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
class FrameHeaderListener
{
public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
@B-Galati
B-Galati / tmux.sh
Last active September 8, 2022 13:00
tmux script example
#!/bin/bash
tmux has-session -t dev
if [ $? != 0 ]
then
tmux new-session -s dev -n "TEST" -d
tmux split-window -h -t dev:0
tmux split-window -v -t dev:0.1
tmux send-keys -t dev:0.0 'cd ~/foo/bar' C-m
tmux send-keys -t dev:0.1 'autossh -M 0 -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" test@test -t "cd ~/bar;bash"' C-m
@B-Galati
B-Galati / Dockerfile
Last active February 24, 2022 22:30
Dockerfile oracle oci8
FROM php:5.4-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libicu-dev \
libmysqlclient18 \
libc6 \
@B-Galati
B-Galati / phpstorm64.vmoptions
Last active December 4, 2018 15:05
phpstorm jvm options
# custom PhpStorm VM options
# https://stitcher.io/blog/phpstorm-performance
-Xms500m
-Xmx1500m
-XX:ReservedCodeCacheSize=512m
-XX:+UseConcMarkSweepGC
-XX:+UseCompressedOops
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
@B-Galati
B-Galati / .atoum.php
Last active May 7, 2016 15:34
Example of atoum configuration time
<?php
use mageekguy\atoum;
use mageekguy\atoum\report\fields\runner\failures\execute;
$cloverWriter = new atoum\writers\file('builds/tests/atoum.coverage.xml');
$cloverReport = new atoum\reports\asynchronous\clover();
$cloverReport->addWriter($cloverWriter);
$xunitWriter = new atoum\writers\file('builds/tests/atoum.xunit.xml');
$xunitReport = new atoum\reports\asynchronous\xunit();
@B-Galati
B-Galati / pre-commit
Last active April 12, 2022 17:05
git pre-commit hook for php
#!/bin/bash
# Inspiration http://wadmiraal.net/lore/2014/07/14/how-git-hooks-made-me-a-better-and-more-lovable-developer/
# http://nrocco.github.io/2012/04/19/git-pre-commit-hook-for-PHP.html
EXITCODE=0
# Check for php syntax error
FILES=$(git diff --cached --name-only)
for FILE in $FILES ; do
if [[ "$FILE" =~ ^.+(php|inc|module|install|test)$ ]]; then
@B-Galati
B-Galati / elasticsearcIndexConfig.json
Created August 3, 2015 07:01
Exemple de configuration d'un index elasticsearch
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
"stringAnalyzer": {
"type": "custom",
@B-Galati
B-Galati / php.ini
Last active February 25, 2016 07:36
[xdebug]
xdebug.cli_color=1
xdebug.show_local_vars=0
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_host=<PHPSTORM host IP>
xdebug.remote_port="9000"
xdebug.idekey=phpstorm
xdebug.scream = 0
xdebug.max_nesting_level=300