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
@skynet
skynet / upgrade-php7.sh
Created December 29, 2018 03:52 — forked from heathdutton/upgrade-php7.sh
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux EC2 to PHP 7.3
#
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5
#
# Must be ran as sudo:
# sudo bash upgrade-php7.sh
#
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
@vluzrmos
vluzrmos / phpstorm.cmder.md
Last active September 13, 2021 03:30
Configurar o Laragon CMDER dentro do PHPSTORM

1- Adicionar a variável de ambiente CMDER_ROOT com o caminho para C:\laragon\bin\cmder (local do cmder no computador)

2- Abrir o phpstorm, ir em File (Menu) > Settings > Tools > Terminal e alterar o caminho padrão "cmd.exe" para:

"cmd.exe" /k ""%CMDER_ROOT%\vendor\init.bat""

3- Pode acontecer de a variável CMDER_ROOT não estar pronta, você pode precisar reiniciar sua máquina.

@patrickmaciel
patrickmaciel / index.php
Last active December 20, 2018 11:18
Compare arrays multidimensional #php
<?php
function array_diff_assoc_recursive($array1, $array2) {
$difference=array();
foreach($array1 as $key => $value) {
if( is_array($value) ) {
if( !isset($array2[$key]) || !is_array($array2[$key]) ) {
$difference[$key] = $value;
} else {
$new_diff = array_diff_assoc_recursive($value, $array2[$key]);
"controller_mappings"
{
"version" "3"
"title" "GW2 Total Control by CoryOp v1"
"description" "#SettingsController_AutosaveDescription"
"creator" "76561198141443709"
"controller_type" "controller_steamcontroller_gordon"
"group"
{
"id" "0"
@noelbundick
noelbundick / LICENSE
Last active September 7, 2025 05:06
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ibrunotome
ibrunotome / laravel-ddd-approach.md
Last active August 25, 2023 23:25
A Domain Driven Design (DDD) approach to the Laravel Framework
/app
├── /Application
|  ├── /Exceptions
|  ├── /Middlewares
|  ├── /Providers
|  ├── /Requests
├── /Domain
|  ├── /MyDomainA
| | ├── /Contracts
@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
@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 / 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"
@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.