Skip to content

Instantly share code, notes, and snippets.

View xthiago's full-sized avatar

Thiago Rodrigues (xthiago) xthiago

View GitHub Profile
git branch -r --merged | egrep -v '(master|main|release|development)' | sed 's/origin\///' | xargs -n 1 git push --delete origin
sudo apt install gedit
cd /tmp/
wget https://download.jetbrains.com/webide/PhpStorm-2021.2.3.tar.gz
tar -zxvf PhpStorm-2021.2.3.tar.gz
mkdir ~/Apps
mv PhpStorm-212.5457.49/ ~/Apps/
ln -s ~/Apps/PhpStorm-212.5457.49 ~/Apps/phpstorm
# shortcut
vim jetbrains-phpstorm.desktop
@xthiago
xthiago / SymfonyKernel.php
Created April 13, 2021 16:55 — forked from jakzal/SymfonyKernel.php
Replacement for Symfony's KernelTestCase
<?php
declare(strict_types=1);
namespace Zalas\PHPUnit\Injector\Symfony\TestCase;
use Symfony\Component\DependencyInjection\ResettableContainerInterface;
use Symfony\Component\HttpKernel\KernelInterface;
/**
* Mimics the behaviour of Symfony's KernelTestCase.
@xthiago
xthiago / global-gitignore.md
Created February 13, 2018 01:02 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
@xthiago
xthiago / git-tag-delete-local-and-remote.sh
Created December 5, 2017 15:00 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@xthiago
xthiago / ddd_cqrs_event-sourcing_in_php.md
Created March 24, 2017 00:26 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@xthiago
xthiago / Docker-for-Mac-with-host-address-alias.md
Last active March 18, 2017 14:52 — forked from ralphschindler/README.md
Docker (For Mac) De-facto Host Address Alias (10.254.254.254) - "The 10254 Trick".

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254

Installation

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

sudo curl -o /Library/LaunchDaemons/com.ralphschindler.docker_10254_alias.plist https://gist.githubusercontent.com/ralphschindler/535dc5916ccbd06f53c1b0ee5a868c93/raw/com.ralphschindler.docker_10254_alias.plist
@xthiago
xthiago / 60-jetbrains.conf
Created October 18, 2016 13:24 — forked from bittner/60-jetbrains.conf
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use
@xthiago
xthiago / gist:54e054540f8571ada9b5f1f853a7ab76
Created September 23, 2016 11:37 — forked from yano3/gist:1378948
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
@xthiago
xthiago / README.md
Created April 24, 2016 02:09 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \