Skip to content

Instantly share code, notes, and snippets.

View aleduca's full-sized avatar

Alexandre Eduardo Cardoso aleduca

View GitHub Profile
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"printWidth": 80
}
semi: ['error', 'always'],
quotes: ['error', 'single'],
indent: ['error', 4], //de acordo com sua preferência
'comma-spacing': ['error', { before: false, after: true }],
var path = require('path')
module.exports = {
'config': path.resolve('database', 'config', 'config.js'),
'migrations-path': path.resolve('database', 'migrations'),
'models-path': path.resolve('database', 'models'),
'seeders-path': path.resolve('database', 'seeders'),
}
@aleduca
aleduca / date.js
Created December 26, 2021 16:00
Date dateformat int
formatar_data = (d) =>{
const date = new Date(d);
const formatter = Intl.DateTimeFormat('pt-BR', {
timeZone: 'UTC',
dateStyle: "short"
});
return formatter.format(date);
var users = [
{
name: "Alexandre",
status: "ativo",
},
{
name: "Joao",
status: "ativo",
},
{
<?php
use PHPMailer\PHPMailer\SMTP;
function send(array $data)
{
$email = new PHPMailer\PHPMailer\PHPMailer;
try {
$email->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Methods: GET,HEAD,OPTIONS,POST,PUT');
header('Access-Control-Allow-Headers:X-Requested-With, Content-Type');
if ('OPTIONS' === $_SERVER['REQUEST_METHOD']) {
die('error');
}
<?php
// errado
namespace app\helpers;
class Uri
{
public static function get($type): string
{
return parse_url($_SERVER['REQUEST_URI'][$type]);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div x-data="data()">
<snippet>
<content><![CDATA[
declare(strict_types=1);
namespace App${TM_FILEPATH/(?:.*app)|(\/)([^\/]+)(?=\/)|(?:\/[^\/]+\.php$)/(?1:\\$^N:$^N)/g};
class ${1:${TM_FILENAME/(.+)\..+|.*/$1/:name}}
{
}
]]></content>