sudo apt update
sudo apt install apache2
sudo apt install curl git unzip
const mergeArrayOfObjects = (arrayA, arrayB, prop) => { | |
const reduced = arrayA.filter((aItem) => !arrayB.find(bItem => aItem[prop] === bItem[prop])); | |
return reduced.concat(arrayB); | |
} |
// import api from 'axios'; // axios is required | |
function getAllData(page = 1, dataList = []) { | |
return new Promise((resolve, reject) => { | |
api.get(`/endpoint/`, { | |
params: { | |
page, // Current pagination page | |
}, | |
}).then((response) => { | |
const newPage = page + 1; |
<!DOCTYPE html> | |
<html lang="pt"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Aula 27022020</title> | |
</head> |
const express = require('express'); | |
const server = express(); | |
server.use(express.json()); | |
// Banco de dados | |
const projects = []; | |
let reqNumber = 0; |
// Criando uma sessão vazia | |
$request->session()->put('bag', []); | |
// Pegando a sessão | |
$bag = $request->session()->get('bag'); | |
print_r($bag); | |
// Inserindo dados em uma sessão | |
$request->session()->push('bag', ['product_id'=>18, 'qty'=> 18,]); | |
$bag = $request->session()->get('bag'); |
module.exports = (cpf) => { | |
return cpf | |
.replace(/\D/g, '') // Substitui caracteres não numericos por vazio | |
.replace(/(\d{3})(\d)/, '$1.$2') // Captura grupos de 3 numeros e adiciona o ponto | |
.replace(/(\d{3})(\d)/, '$1.$2') | |
.replace(/(\d{3})(\d{1,2})/, '$1-$2') | |
.replace(/(-\d{2})\d+?$/, '$1') // Captura dois numeros após um traço (-) e impede a inserção de novos números | |
} |
#include <QCoreApplication> | |
#include <opencv2/opencv.hpp> | |
using namespace cv; | |
int binariza(int pixel, int nivel) { | |
if(pixel <= nivel) { | |
pixel = 0; | |
} else { | |
pixel = 255; |
/* | |
* Implementação em JavaScript por Johnny Ferreira (https://gist.github.com/johnnyferreiradevweb/) | |
* baseado na implementação de BárbaraGCOL (https://github.com/BarbaraGCOL) | |
*/ | |
/* Um campo do vetor que contera a melhor rota */ | |
function Rota() { | |
var cidade1, cidade2, custo; | |
} |