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

Para criar uma conexão com o Oracle em um projeto Laravel, você precisará seguir estes passos:

Instale o pacote oci8 do PHP:

pecl install oci8

Adicione a extensão oci8 ao seu arquivo php.ini:

@tadeubdev
tadeubdev / post-receive
Created January 5, 2023 12:25
post-receive
#!/usr/bin/env bash
# Verifique se houve alterações no arquivo package.json ou composer.json
while read oldrev newrev refname
do
if [[ $(git diff --name-only $oldrev $newrev | grep "package\.json$") != "" ]]; then
rm -rf node_modules
npm install --production
fi
@tadeubdev
tadeubdev / codigoPaises.js
Created October 14, 2022 11:41
Código dos países
const codigoPaises = [
{'code': '1', 'value': '+1 Republic'},
{'code': '7', 'value': '+7'},
{'code': '20', 'value': '+20'},
{'code': '27', 'value': '+27 Africa'},
{'code': '30', 'value': '+30'},
{'code': '31', 'value': '+31'},
{'code': '32', 'value': '+32'},
{'code': '33', 'value': '+33'},
{'code': '34', 'value': '+34'},
@tadeubdev
tadeubdev / tasks.html
Last active September 11, 2022 16:24
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tasks</title>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
@tadeubdev
tadeubdev / convert-postman-to-insomnia.js
Created August 3, 2022 18:51 — forked from wesleyegberto/convert-postman-to-insomnia.js
Script to convert a Postman backupt to Insomnia
/**
* Script to parse a Postman backupt to Insomnia keeping the same structure.
*
* It parses:
* - Folders
* - Requests
* - Environments
*
* Notes: Insomnia doesn't accept vars with dots, if you are using you must replace yours URLs manually (see ENVIRONMENTS_EXPORTS).
*/
@tadeubdev
tadeubdev / remove-all-videos-from-watch-later-on-youtube.js
Last active January 13, 2024 23:55
Remove all videos from watch later on youtube
(async () => {
for (let btn of document.querySelectorAll('#contents .dropdown-trigger.style-scope.ytd-menu-renderer')) {
btn.click();
await (async () => {return new Promise(resolve => setTimeout(resolve, 100))})();
document.querySelectorAll('ytd-popup-container ytd-menu-service-item-renderer')[2].click();
await (async () => {return new Promise(resolve => setTimeout(resolve, 500))})();
}
})();
const fs = require('fs');
const baseUrl = 'root@{ip}';
// get all git directories in the current directory
const gitDirs = fs.readdirSync('./').filter(dir => fs.statSync(dir).isDirectory() && fs.existsSync(`${dir}/hooks`));
const pwd = process.cwd();
gitDirs.forEach(dir => {
const name = dir.toString().replace('.git', '');
const url = `${baseUrl}:${pwd}/${dir}`;
{"version":1,"resource":"file:///var/www/html/callon/dash/resources/views/canal/tabs/bot.blade.php","entries":[{"id":"Xzdz.php","timestamp":1655390444484},{"id":"Esnv.php","timestamp":1655390590971},{"id":"I0nl.php","timestamp":1655390853750},{"id":"wr9X.php","timestamp":1655398784774}]}
<?php
class CadastraUsuario
{
public function __construct(
string $nome,
string $email,
string $cpf,
string $endereco,
string $numero,
<?php
function cadastraUsuario($nome, $email, $senha)
{
$db = Database::prepare('INSERT INTO usuarios (nome, email, senha) VALUES (:nome, :email, :senha);');
$db->bindParam(':nome', $nome);
$db->bindParam(':email', $email);
$db->bindParam(':senha', $senha);
$db->execute();
}