Skip to content

Instantly share code, notes, and snippets.

View patrickmaciel's full-sized avatar
🙏
Jesus is coming!

Patrick Maciel patrickmaciel

🙏
Jesus is coming!
View GitHub Profile
@luzfcb
luzfcb / configurar_pyenv.md
Last active January 15, 2025 15:49
instalar pyenv no ubuntu
@agarzon
agarzon / install-php-tools.sh
Last active October 27, 2021 03:48
Install globally popular PHP dev tools like composer, phpunit, phpcs, phpmd, phpcpd, deployer, robo, codeception, etc.
#!/bin/bash
#To execute it directly: sudo bash <(curl -s https://gist.githubusercontent.com/agarzon/ecb0b92d4c8e1bbde126534c76721a58/raw/install-php-tools.sh)
BIN_PATH=/usr/local/bin/
#COMPOSER
sudo curl -LsS https://getcomposer.org/composer.phar -o ${BIN_PATH}composer
sudo chmod a+x ${BIN_PATH}composer
@sixeyed
sixeyed / Set-ProfileForDocker.ps1
Last active December 2, 2024 20:30
PowerShell aliases for working with Docker on Windows - save to $profile
#docker rm $(docker ps -a -q)
function Remove-StoppedContainers {
foreach ($id in & docker ps -a -q) {
& docker rm $id }
}
#docker rmi $(docker images -f "dangling=true" -q)
function Remove-DanglingImages {
foreach ($id in & docker images -q -f 'dangling=true') {
& docker rmi $id }
@wojteklu
wojteklu / clean_code.md
Last active May 8, 2025 10:02
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@joseluisq
joseluisq / 1README.md
Last active January 3, 2022 13:22
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

Lumen 5 HTTP Exception Handlers with JSON support.

Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

image

Setup

Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php

@ricogoh
ricogoh / .php_cs
Last active March 4, 2020 02:12
PHP Coding Standards Fixer setting for Laravel 5 on FriendsOfPHP/PHP-CS-Fixer 2.*
<?php
/**
* PHP Coding Standards Fixer setting for Laravel 5 on friendsofphp/php-cs-fixer 2.*
* Rules with psr1, psr2, phpdoc and some symfony rules.
* Rules only apply directory and sub-directory inside "app".
*
* Save script to .php_cs and place .php_cs file in the root of your Laravel project
*
* Requirement:
@vukanac
vukanac / install-php72-osx.md
Created August 20, 2017 19:26
How to install php72 on Mac OS X with homebrew.

Skip this:

brew tap homebrew/dupes
brew tap homebrew/versions

As:

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
@patrickmaciel
patrickmaciel / aliases
Last active December 20, 2018 11:34
Aliases git bash / bash ubuntu windows 10 / cygwin #alias #bash
alias gst="git status"
alias gcm="git commit -m"
alias gca="git commit -a"
alias gaa="git add --all"
alias cc="cd /c"
alias comdo="composer dump-autoload -o"
alias comda="composer dump-autoload"
alias vhosts="vim /c/Windows/System32/drivers/etc/hosts"
alias tinker="php artisan tinker"
alias arti="php artisan"
@patrickmaciel
patrickmaciel / utils.php
Last active December 20, 2018 11:34
Data mysql para BR e vice versa #php
<?php
// Se você quer converter uma data vinda do MYSQL para o formato PT-BR use o seguinte comando:
$data = implode("/",array_reverse(explode("-",$data)));
// Assim vai converter a data do mysql para o formato brasileiro.
// Ex: 2010-31-04 para 31/04/2010
// Se você quer converter uma data em formato brasileiro para inserir no mysql use:
@patrickmaciel
patrickmaciel / phpinstall.sh
Last active February 23, 2023 15:57
PHP 7.4 Install Ubuntu 22.04 #php #apt #php #ubuntu
#!/bin/sh
# This command and the ppa and auto apt-get update after that
sudo env LC_ALL=C.UTF-8 add-apt-repository --yes ppa:ondrej/php
# Install PHP 7.2 and the most common extesions
sudo apt-get install php7.4-fpm php7.4-common php7.4-dev php7.4-curl php7.4-gd php7.4-json php7.4-mysql php7.4-odbc php7.4-pgsql php7.4-pspell php7.4-readline php7.4-sqlite3 php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-bcmath php7.4-bz2 php7.4-intl php7.4-mbstring php7.4-phpdbg php7.4-soap php7.4-zip php-imagick php-redis php-memcached