Skip to content

Instantly share code, notes, and snippets.

@elinardo10
elinardo10 / install_docker.sh
Created September 4, 2024 03:41
Instalando docker e docker composer
#!/bin/bash#
# Recipe Name: Install Docker and Docker-Compose
# Run as user: root
# Recipe:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Focal = Ubuntu 22
# Run `lsb_release -cs` to discover yours if not 22
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
@elinardo10
elinardo10 / setup_user.sh
Created September 4, 2024 01:09
Bash Setup init Usuário
#!/bin/bash#
Defina o nome do usuário
USERNAME="novousuario"
# Cria o usuário com uma pasta home e um shell bash
sudo adduser --home "/home/$USERNAME" --shell /bin/bash $USERNAME
# Adiciona o usuário ao grupo sudo para que ele tenha privilégios administrativos (opcional)
sudo usermod -aG sudo $USERNAME
# Cria as pastas padrão do usuário
@elinardo10
elinardo10 / total.js
Last active February 8, 2023 14:58
Desafio do Mestre Tiago Matos
// Faça o calculo do total destes produtos que estão no carrinho
const cart = [
{
name: 'Pizza de calebreza',
amount: 10,
qty: 2,
addons: [
{
'name': 'Extra calabreza',
@elinardo10
elinardo10 / cupton.vue
Created December 26, 2022 03:33
cupton estilo
<template>
<div>
<table
class="printer-ticket"
>
<thead>
<tr>
<th
class="title"
colspan="3"
@elinardo10
elinardo10 / DuplicateProducService.php
Last active November 21, 2022 20:07
Duplicar Model com relação e relação da relação
<?php
public function duplicate(Product $product)
{
$this->authorize('duplicateProduct', $product);
$newProduct = $product->replicate();
$newProduct->name = $product->name . " [Cópia]";
$newProduct->save();
$product->load('variations.items');
@elinardo10
elinardo10 / WhatsappQrcodeConnect.vue
Last active June 10, 2022 18:09
fluxo de eventos wppconnect com nuxtjs/vue
<template>
<div>
<template v-if="initQrcode">
<TWAlert
v-if="response.variant === 'danger'"
:variant="response.variant"
dismissible
>
<span v-html="response.message" />
</TWAlert>
<template>
<div
id="exampleModal"
ref="modal"
class="modal fade"
:class="{ show: active, 'd-block': active }"
data-bs-backdrop="static"
data-bs-keyboard="false"
tabindex="-1"
aria-hidden="true"
<template>
<div>
<ValidationObserver
ref="formBusinesPix"
tag="form"
@submit.stop.prevent="save()"
>
<div class="grid gap-10">
<PaymentPixForm
ref="businessPixForm"
@elinardo10
elinardo10 / SocialController.php
Last active June 5, 2020 18:09
Social Auth laravel API + Nuxt/VUE
<?php
namespace App\V1\Auth\Controllers;
use App\V1\Auth\Services\SocialService;
use App\Http\Controllers\Controller;
use App\V1\Auth\Requests\AuthSocialLoginRequest;
class SocialController extends Controller
{
<template>
<div>
<ValidationObserver ref="form">
<form>
<TwCard
shadow
rounded
no-body
elevated="lg"
>