Skip to content

Instantly share code, notes, and snippets.

View ferodss's full-sized avatar

Felipe Rodrigues ferodss

View GitHub Profile
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
<?xml version="1.0" encoding="UTF-8"?>
<project name="my-project" default="build">
<target name="build" depends="prepare,install-dependencies,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpunit,phpcb"/>
<target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
@ferodss
ferodss / install_scala_sbt_play.sh
Last active December 26, 2015 09:29 — forked from visenger/install_scala_sbt.sh
Install Scala Lang 2.10.3, Scala SBT 0.13.0 and Play Framework 2.2.0
#!/bin/sh
echo "Downloading and installing Scala 2.10.3..."
sudo /usr/local/src
sudo wget -c http://www.scala-lang.org/files/archive/scala-2.10.3.tgz
sudo tar zxf scala-2.10.3.tgz
sudo mv scala-2.10.3 /usr/share/scala
sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala
@ferodss
ferodss / Product.php
Last active October 5, 2020 12:22
Doctrine 2 ManyToMany with Extra fields
<?php
namespace Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Product entity
*
* @ORM\Table(name="catalog_product")
@ferodss
ferodss / .bashrc
Last active December 25, 2015 01:59
Show Git branch from current directory
# SHOW GIT BRANCH
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# no colors
export PS1="\u@\h:\W \$(parse_git_branch)\$ "
# with some colors
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\]:\W \$(parse_git_branch)\$\[\033[00m\] "
@ferodss
ferodss / gist:5774302
Created June 13, 2013 14:50
init.d script for Apache
#!/bin/bash
#
# httpd Startup script for the Apache HTTP Server
#
# chkconfig: - 85 15
# description: The Apache HTTP Server is an efficient and extensible \
# server implementing the current HTTP standards.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
@ferodss
ferodss / gist:5762620
Last active April 10, 2016 17:29
Compile Apache 2.4.4 with SSL, FastCGI and PHP 5.4 as FPM on CentOS for Magento store
### ADD RPM Forge repository
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # Verifies the package
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
### APACHE
# Dependencies
@ferodss
ferodss / gist:5762495
Created June 12, 2013 02:46
Install MySQL Percona Server on CentOS
# Add Percona repository
rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm
# Install
yum install Percona-Server-client-55 Percona-Server-server-55
# Set root password
mysql -u root
mysql> use mysql;