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 / 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 / gist:d43efdac1dd08faf08f1
Last active August 29, 2015 14:01
Replace "from" with "to" keeping backup of original files
for i in *; do cat $i | sed s/from/to/g > $i.out; mv $i $i.bkp; mv $i.out $i; done
@danielcosta
danielcosta / gist:b89f23547915db999b27
Created May 21, 2014 19:46
Kill all processes by PID identifier
alias pid='ps aux | pgrep -d " " ';
kill -9 $(pid chrome)
@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 / post-merge
Created September 17, 2014 17:41
post-merge hook for bob/alice (mobly)
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# 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"
#!/bin/bash
# POMODORO
# usage: pomo | pomo short | pomo long
SLEEPTIME=1500
TITLE="POMODOR0 :)"
SUBTITLE="Take a Break :)"
if [ "$1" = "long" ]; then
2015-02-03 10:23:36 -0200
/usr/local/opt/php56/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
@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'
);
@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" \