Skip to content

Instantly share code, notes, and snippets.

Daniel Costa danielcosta

Block or report user

Report or block danielcosta

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
danielcosta /
Last active Jul 19, 2017
Lint changed PHP files
#!/usr/bin/env bash
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
ANCESTOR=$(git merge-base $CURRENT_BRANCH master)
IFS=$'\n' FILES=($(git diff --name-status $ANCESTOR HEAD | grep -E '^[AM].+\.php$' | awk '{print $2}'))
danielcosta /
Created Jul 10, 2017
Install Teamviewer on Debian
sudo dpkg --add-architecture i386
sudo apt update
cd ~/Downloads
curl -L -o teamviewer_i386.deb ""
sudo apt install -y ./teamviewer_i386.deb
rm teamviewer_i386.deb
danielcosta /
Last active Nov 2, 2018
Script to update PhpStorm and others Jetbrains products
#!/usr/bin/env bash
case "${1}" in
case "${2}" in
danielcosta /
Created Apr 7, 2017
Run docker-compose inside a container
# Run docker-compose in a container
# This script will attempt to mirror the host paths by using volumes for the
# following paths:
# * $(pwd)
# * $(dirname $COMPOSE_FILE) if it's set
# * $HOME if it's set
danielcosta / Dockerfile.php-5.5
Last active Apr 24, 2019
Compile memcache on alpine container for PHP 5.5 and 5.6
View Dockerfile.php-5.5
# php-5.5
FROM daccbr/php:5.5-fpm-alpine
RUN addgroup -g 1000 sumup && adduser -u 1000 -h /home/sumup -H -G sumup -s /bin/false -D sumup
RUN apk --update add openssh-client libtool make grep autoconf gcc libc-dev zlib-dev
RUN cd /tmp \
&& apk --update add cyrus-sasl-dev libmemcached-dev \
&& curl -L --progress-bar -o "php-memcached-2.2.0.tar.gz" "" \
danielcosta / ProtectedMethodTest.php
Created Sep 25, 2015
If you really need to test a protected class...
View ProtectedMethodTest.php
class ProtectedMethodTest extends PHPUnit_Framework_TestCase
public function testProtectedMethod()
$method = self::getMethod(
View 01.phpize
2015-02-03 10:23:36 -0200
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
# usage: pomo | pomo short | pomo long
SUBTITLE="Take a Break :)"
if [ "$1" = "long" ]; then
danielcosta / post-merge
Created Sep 17, 2014
post-merge hook for bob/alice (mobly)
View post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus -
# git hook to run a command after `git pull` or `git merge` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"

Keybase proof

I hereby claim:

  • I am danielcosta on github.
  • I am danielcosta ( on keybase.
  • I have a public key ASDEDoD_51rq6giZ8gWsG1a5cKAehbzkMp93GyKUyteOsgo

To claim this, I am signing this object:

You can’t perform that action at this time.