Skip to content

Instantly share code, notes, and snippets.

View xthiago's full-sized avatar

Thiago Rodrigues (xthiago) xthiago

View GitHub Profile
@aldenw
aldenw / gist:a64c01ff9f18c660f114d2611fa6bb06
Last active May 23, 2023 19:48
Delete already merged remote branches
git branch -r --merged | egrep -v '(master|main|release|development)' | sed 's/origin\///' | xargs -n 1 git push --delete origin
@celosauro
celosauro / .gitconfig
Last active February 27, 2020 15:50
.gitconfig file
[user]
name =
email =
# username =
[core]
editor = nano
#whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[web]
browser = google-chrome
@krisleech
krisleech / renew-gpgkey.md
Last active April 22, 2024 20:13
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@ralphschindler
ralphschindler / README.md
Last active September 30, 2023 19:28
Docker For Mac Host Address Alias To Enable PHP XDebug (10.254.254.254 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.

Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host.

Installation Of IP Alias (This survives reboot)

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

@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
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 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@fideloper
fideloper / install.sh
Last active October 30, 2023 20:03
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@erikhenrique
erikhenrique / bin-cc.md
Last active February 5, 2024 16:06
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
@mCzolko
mCzolko / FA2Symfony2.md
Last active April 23, 2019 04:11
How to integrate Font Awesome to Symfony 2

Integration

It's easy to integrate Font Awesome into Symfony2 (Twitter Bootstrap, or even use it on its own).

Composer

Add those lines to composer.json

{
  "repositories": [
    {
      "type": "package",
@charliepage88
charliepage88 / symfonyCSV.html.twig
Created February 16, 2013 20:23
Symfony 2 CSV Export
id, field1, field2, field3
{% for row in data %}
{{ row.id }},{{ row.field1 }},{{ row.field2 }},{{ row.field3 }}
{% endfor %}
@marijn
marijn / Example.php
Created April 3, 2012 16:53
An example on sorting Doctrine\Common\Collection\ArrayCollection elements
<?php
$collection = new Doctrine\Common\Collection\ArrayCollection();
// add objects to the collection that contain a getCreated method returning a DateTime instance
$iterator = $collection->getIterator();
$iterator->uasort(function ($first, $second) {
if ($first === $second) {