Skip to content

Instantly share code, notes, and snippets.

View guimossibento's full-sized avatar

GUILHERME MOSSI BENTO guimossibento

View GitHub Profile
@guimossibento
guimossibento / response-json.php
Created April 4, 2022 13:26
Get Json Content with PHP
<?php
$data = json_decode(file_get_contents('php://input'), true);
print_r($data);
echo $data["operacion"];
@guimossibento
guimossibento / laravel-work.conf
Created April 4, 2022 13:24
Laraver Supervisor Config
[program:laravel-comments]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/project/artisan queue:work --queue=queuename --tries=100000000 --timeout=100000000
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=root
numprocs=8
redirect_stderr=true
@guimossibento
guimossibento / ssh_key_commnad.md
Last active February 14, 2022 17:33
Configurar acesso SSh com key
  • instalar putty-tools

  • cria uma key com a ppk

    • caminho da ppk e caminho da key
 puttygen /home/user/Desktop/file.ppk -O private-openssh -o /home/user/.ssh/file.key
  • permissao

@guimossibento
guimossibento / ovpn_command.txt
Created February 7, 2022 18:58
Rodar OPEN VPN LINUX
sudo openvpn --config /etc/openvpn/client/file.ovpn
@guimossibento
guimossibento / passport_keys.txt
Created February 7, 2022 18:57
Gerar passport keys
This is because you didn't generate Oauth keys using passport keys.
Run
php artisan passport:keys
After that run the following command to generate a personal access client
php artisan passport:client --personal
@guimossibento
guimossibento / command.txt
Last active February 24, 2022 15:10
listagem comandos e criar comando para continuar rodando
ps -ef | grep 'php artisan queue:work'
pkill -f 'php artisan queue:work'
nohup php artisan queue:work --daemon > /dev/null 2>&1 &
nohup php artisan queue:work --queue=comment-task --tries=100000000 --timeout=100000000 --daemon > /dev/null 2>&1 &
@guimossibento
guimossibento / gist:b9a3b32c01e5bc1fd34b93f66ee2b155
Created January 23, 2022 20:13
Remove all changes from repository
If you want to revert changes made to your working copy, do this:
git checkout .
If you want to revert changes made to the index (i.e., that you have added), do this. Warning this will reset all of your unpushed commits to master!:
git reset
If you want to revert a change that you have committed, do this:
git revert <commit 1> <commit 2>
If you want to remove untracked files (e.g., new files, generated files):
@guimossibento
guimossibento / pivot-tables.md
Created December 18, 2021 16:35 — forked from Braunson/pivot-tables.md
Laravel 8.x - Diving into Pivot Tables

Laravel 6 - Diving Into Pivot Tables

Pivot tables can be confusing and a little hard to wrap your head around at first. In this quick article we are going to dive into what a pivot table is, how to create one and finally how to use the pivot table. Let's dive in!

What is a pivot table?

A pivot table is used to connect relationships between two tables. Laravel provides a Many To Many relationship where you can use a pivot table.

<?php
DB::table('registry_options')
->where(fn(Builder $query) => $query
->where('app_id', AppEnum::PLATAFOOR)
->orwhere('app_id', request()->appId()))
->where('code', $value)
->dd();

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example