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 git@github.com: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 / gist:971e7173016843cf105517dbc53b881f
Created January 29, 2021 16:21
How to install ffmpeg on Amazon Linux rhel fedora
mkdir -v -p /usr/local/bin/ffmpeg
cd /usr/local/bin/ffmpeg
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-i686-static.tar.xz
tar -v -xf ffmpeg-release-i686-static.tar.xz --strip-components=1
rm -v -f ffmpeg-release-i686-static.tar.xz
ln -snf /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg
ln -snf /usr/local/bin/ffmpeg/ffpropbe /usr/bin/ffpropbe
@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{