This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gitcommit { | |
# get the basename of the current directory | |
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; | |
# retrieve the current COMMIT status of the GIT repo | |
status=$(git status -s); | |
# check if there are files that need to be committed | |
# if there are something to commit, do the git commit process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# disable xdebug warning | |
COMPOSER_DISABLE_XDEBUG_WARN=1 | |
# define timeout | |
COMPOSER_PROCESS_TIMEOUT=10000 | |
# update composer.phar | |
composer self-update; | |
# discard changes in vendors packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property environment="env" /> | |
<available file="commandname" | |
filepath="${env.PATH}" | |
property="commandname.present"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## manually install each | |
$ composer global require phpunit/phpunit | |
$ composer global require phpunit/dbunit | |
$ composer global require phing/phing | |
$ composer global require phpdocumentor/phpdocumentor | |
$ composer global require sebastian/phpcpd | |
$ composer global require phploc/phploc | |
$ composer global require phpmd/phpmd | |
$ composer global require squizlabs/php_codesniffer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
# Inspired from https://gist.github.com/faleev/3435377 | |
# Remove any existing packages: | |
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
# Get the dependencies (Ubuntu Server or headless users): | |
sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm uninstall -g gulp | |
npm install -g gulp | |
npm uninstall --save-dev gulp | |
npm install --save-dev gulp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{ENV:URI} ^$ | |
RewriteRule ^(.*)$ - [ENV=URI:$1] | |
RewriteCond %{ENV:BASE} ^$ | |
RewriteCond %{ENV:URI}::%{REQUEST_URI} ^(.*)::(.*?)\1$ | |
RewriteRule ^ - [ENV=BASE:%2] | |
# somewhere in the Rewrite | |
RewriteRule (.*\.less) %{ENV:BASE}less.php?path=$1 [L,NC,QSA] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"provide": { | |
"ext-foo":"*", | |
"ext-curl":"*" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove multiple slashes anywhere in url | |
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ | |
RewriteRule . %1/%2 [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @dbName = 'db_name'; | |
SET FOREIGN_KEY_CHECKS = 0; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = @dbName; -- specify DB name here. | |
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables); | |
PREPARE stmt FROM @tables; | |
EXECUTE stmt; |