Skip to content

Instantly share code, notes, and snippets.

View danielcosta's full-sized avatar

Daniel Costa danielcosta

View GitHub Profile
@danielcosta
danielcosta / integrating_jira_with_sourcetree.md
Last active November 7, 2023 21:03
Learn how to integrate your SourceTree repositories with JIRA

Integrating JIRA with SourceTree

Overview

You will learn how to link your JIRA tasks directly on SourceTree

Step by step

1. Setting

@danielcosta
danielcosta / fix-mic-volume.md
Created June 30, 2022 15:31
Microphone settings for Linux

Fix Microphone Volume - or stop it from auto-adjustment

Check current volume

To see the current volume, run alsamixer. Let's consider the current volume shown is 40.

How to determine the .conf file for your microphone

Run pacmd list-sources.

@danielcosta
danielcosta / Dockerfile.php-5.5
Last active September 18, 2021 03:17
Compile memcache on alpine container for PHP 5.5 and 5.6
# 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" "https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz" \
@danielcosta
danielcosta / docker-compose.sh
Created April 7, 2017 15:18
Run docker-compose inside a container
#!/bin/bash
#
# 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
danielcosta / updateJetbrains.sh
Last active April 30, 2020 02:38
Script to update PhpStorm and others Jetbrains products
#!/usr/bin/env bash
VERSION_PATTERN="([0-9]+\.[0-9]+\.[0-9]+)"
case "${1}" in
"phpstorm")
TOOL_NAME="PhpStorm"
INSTALL_DIR="/opt/phpstorm"
case "${2}" in
"eap")
@danielcosta
danielcosta / install-teamviewer.sh
Created July 10, 2017 14:23
Install Teamviewer on Debian
sudo dpkg --add-architecture i386
sudo apt update
cd ~/Downloads
curl -L -o teamviewer_i386.deb "https://download.teamviewer.com/download/teamviewer_i386.deb"
sudo apt install -y ./teamviewer_i386.deb
rm teamviewer_i386.deb
@danielcosta
danielcosta / lint-php.sh
Last active July 19, 2017 14:31
Lint changed PHP files
#!/usr/bin/env bash
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
ANCESTOR=$(git merge-base $CURRENT_BRANCH master)
OIFS=$IFS
IFS=$'\n' FILES=($(git diff --name-status $ANCESTOR HEAD | grep -E '^[AM].+\.php$' | awk '{print $2}'))
IFS=$OIFS
php-lint.sh "${FILES[@]}"
@danielcosta
danielcosta / keybase.md
Last active March 10, 2017 01:52
keybase.md

Keybase proof

I hereby claim:

  • I am danielcosta on github.
  • I am danielcosta (https://keybase.io/danielcosta) on keybase.
  • I have a public key ASDEDoD_51rq6giZ8gWsG1a5cKAehbzkMp93GyKUyteOsgo

To claim this, I am signing this object:

@danielcosta
danielcosta / README.md
Last active December 19, 2015 01:59 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@danielcosta
danielcosta / ProtectedMethodTest.php
Created September 25, 2015 16:22
If you really need to test a protected class...
<?php
class ProtectedMethodTest extends PHPUnit_Framework_TestCase
{
public function testProtectedMethod()
{
$method = self::getMethod(
'MyClass',
'getProtectedMethodReturnsTrue'
);