Skip to content

Instantly share code, notes, and snippets.

View tadeubdev's full-sized avatar
🎯
Focusing

Tadeu Barbosa tadeubdev

🎯
Focusing
  • Espírito Santo, Brasil
View GitHub Profile
<?php
namespace App\Repositories\Usuario;
class CadastrarUsuarioMemoriaRepository implements CadastrarUsuarioRepository
{
private $name;
private $email;
private $password;
<?php
namespace App\Repositories\Usuario;
class CadastrarUsuarioPdoRepository implements CadastrarUsuarioRepository
{
private $name;
private $email;
private $password;
<?php
namespace App\Repositories\Usuario;
interface CadastrarUsuarioRepository
{
public function __construct(string $name, string $email, string $password);
public function execute(): bool;
}
<?php
namespace App\Repositories\Usuario;
class CadastrarUsuarioRepository
{
private $name;
private $email;
private $password;
<?php
$dbname = 'dbname';
$user = 'user';
$password = 'password';
$dbh = new PDO('mysql:host=localhost;dbname='.$dbname, $user, $password);
$tables = $dbh->query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA='{$dbname}'");
<?php
$dbname = 'dbname';
$user = 'username';
$password = 'password';
$dbh = new PDO('mysql:host=localhost;dbname='.$dbname, $user, $password);
$tables = $dbh->query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA='{$dbname}'");
foreach($tables as $row) {
$name = $row[0];
<?php
// pegue todos os arquivos .php dentro do diretório views
$files = glob('path/views/*.php');
foreach ($files as $file) {
// altere a extensão de .php para .blade.php
$newFile = preg_replace('/\.php$/', '.blade.php', $file);
rename($file, $newFile);|
//
$content = file_get_content($newFile);
{"lastUpload":"2022-01-04T14:05:49.031Z","extensionVersion":"v3.4.3"}
const venom = require('venom-bot');
venom
.create()
.then((client) => start(client))
.catch((erro) => console.error(erro));
function start(client) {
console.log("- O venom foi iniciado com sucesso! ;D");
}
{"lastUpload":"2021-05-12T21:22:46.157Z","extensionVersion":"v3.4.3"}