Skip to content

Instantly share code, notes, and snippets.

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include("vendor/autoload.php");
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$array_filtrado = array_filter($_POST['proj'], function ($item) {
return $item['vinculo_tal'] != "";
<?php
namespace Tests\Unit;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ArrayOrderTest extends TestCase
{
/**
const reqObject = {
url: 'https://myendpoint.com/cnpj',
method: 'GET',
header: 'token: MYTOKEN'
};
pm.sendRequest(reqObject, (err, res) => {
const returned_date = res.json()
pm.collectionVariables.set ("fetched_cnpj", returned_date.data.cnpj);
});
<?php
namespace App\Http\Controllers;
use App\CNPJ;
use Illuminate\Http\Request;
use Goutte\Client;
use GuzzleHttp\Client as GuzzleClient;
class GoutteController extends Controller
let selector = "#content > ul > li > a:nth-child(1)";
for (let e of document.querySelectorAll(selector)) {
e.style.border = "thick solid #0000FF";
e.style.backgroundColor = "red";
e.style.color = 'white';
}
@samhk222
samhk222 / Instalar o repositório
Last active March 9, 2022 01:27
Webscrapping Tutorial
git clone [email protected]:samhk222/tutorial-webscrapping-laravel.git
cd tutorial-webscrapping-laravel
composer update
npm install # ou sudo npm install, dependendo do seu sistema
php artisan serve
Abra a url no chrome http://127.0.0.1:8000
@samhk222
samhk222 / Login antes
Created October 22, 2021 14:58
Diferença de login
<?php require_once 'assets/inc/head.php';
?>
<title>Login - <?php echo$titulo; ?></title>
</head>
<body class="login_page ">
<div class="container">
<div class="content">
<div class="col-12">
<?php if ($subpage == 'index'): ?>
<div class="form col-lg-6 col-sm-10 col-md-9">
<?php
require_once dirname(__FILE__) . '/auth/conn.php';
$page = !isset($_GET['page']) ? 'index' : $_GET['page'];
$subpage = !isset($_GET['subpage']) ? '' : $_GET['subpage'];
$page_id = !isset($_GET['page_id']) ? '' : $_GET['page_id'];
$manutencao = 0;
for ($i = 1; $i <= 40; $i++) {
${"manutencao_page_" . $i} = "";
<?php
require_once dirname(__FILE__) . '/auth/conn.php';
if (!isset($_GET['page'])) {
$page = 'index';
}else{
$page = $_GET['page'];
}
if (!isset($_GET['subpage'])) {
$subpage = '';
}else{
version: '3'
services:
db:
container_name: IVW-postgres
env_file: .docker/.env
image: postgres
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
volumes: