Skip to content

Instantly share code, notes, and snippets.

View TaffarelXavier's full-sized avatar
🎯
Focusing

Taffarel Xavier TaffarelXavier

🎯
Focusing
View GitHub Profile
@TaffarelXavier
TaffarelXavier / Font Awesome Snipper to Vscode.md
Created May 30, 2024 12:30
Generate Font Awesome Snipper to Vscode in php
$fontawesome = array("glass", "music", "search", "envelope-o", "heart", "star", "star-o", "user", "film", "th-large", "th", "th-list", "check", "remove", "close", "times", "search-plus", "search-minus", "power-off", "signal", "gear", "cog", "trash-o", "home", "file-o", "clock-o", "road", "download", "arrow-circle-o-down", "arrow-circle-o-up", "inbox", "play-circle-o", "rotate-right", "repeat", "refresh", "list-alt", "lock", "flag", "headphones", "volume-off", "volume-down", "volume-up", "qrcode", "barcode", "tag", "tags", "book", "bookmark", "print", "camera", "font", "bold", "italic", "text-height", "text-width", "align-left", "align-center", "align-right", "align-justify", "list", "dedent", "outdent", "indent", "video-camera", "photo", "image", "picture-o", "pencil", "map-marker", "adjust", "tint", "edit", "pencil-square-o", "share-square-o", "check-square-o", "arrows", "step-backward", "fast-backward", "backward", "play", "pause", "stop", "forward", "fast-forward", "step-forward", "eject", "chevron-
@TaffarelXavier
TaffarelXavier / Hosting n8n with mysql on an amazon aws ec2 ubuntu 20.04 instance.md
Created June 28, 2023 23:35
Hosting n8n with mysql on an amazon aws ec2 ubuntu 20.04 instance
@TaffarelXavier
TaffarelXavier / gerador-content.md
Created May 29, 2023 12:09
Gerador de conteúdo usando vuejs, axios, boostrap e lodash
<!doctype html>
<html lang="pt-br">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <title>html5boilerplate Bootstrap com Vue</title>
@TaffarelXavier
TaffarelXavier / Laravel Migrations Generator.md
Last active April 24, 2023 03:34
Algumas ferramentas para trabalhar com migrations, models, no laravel.
@TaffarelXavier
TaffarelXavier / Converter soma de minutos em formato de horas.md
Last active April 5, 2023 18:09
Converter soma de minutos em formato de horas (ex: 70min = 01:10) em php

Converter soma de minutos em formato de horas (ex: 70min = 01:10) php

function converterHoras($tempos)
{
    $hor = 0;
    $min = 0;

    foreach ($tempos as $tempo) {
 $hora_inicial = Carbon::createFromFormat('H:i', $tempo);

Trabalhando com eventos, listeres e filas no Laravel

"Um work (trabalhador) de fila é um processo regular que é executado em segundo plano e pesquisa o back-end da fila em busca de trabalhos não processados. Para iniciar um novo trabalhador, execute o comando php artisan queue:work dentro do diretório do seu projeto. O work (trabalhador) iniciará e começará processar o(s) trabalho(s) não processado(s) imediatamente." 1

1.php artisan make:mail PostCommentedMail --markdown=emails.posts.new-comment.blade

namespace App\Mail;
 
use App\Models\Comment;
@TaffarelXavier
TaffarelXavier / cordova-sqlite-vuejs.md
Last active September 30, 2022 03:36
Cordova sqlite vuejs

Cordova sqlite vuejs

Content

  • package.json
  • index.html

package.json

{

EN: Shows all users who are completing their year on the current date
PT_BR: Mostra todos os usuários que estão completando ano na data atual.
ES: Muestra todos los usuarios que están completando su año en la fecha actual

SELECT age, DATE_FORMAT(age, "%d-%m") ageMonth FROM users
HAVING ageMonth = DATE_FORMAT(CURRENT_DATE, "%d-%m");
@TaffarelXavier
TaffarelXavier / Determina a idade dos alunos.md
Last active July 13, 2022 14:52
Determina a idade dos alunos
SELECT 
    alu_id, 
    alu_data_nasicmento, 
    TIMESTAMPDIFF(YEAR,convertDateDDMMYYYToYYYY_MM_DD(alu_data_nasicmento),CURDATE()) AS idade
from alunos;

No caso, convertDateDDMMYYYToYYYY_MM_DD é uma função Mysql.