TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
<?php | |
/** | |
* @param {string} $search | |
* @param {array} $datas | |
* @return {array} | |
*/ | |
public function search($search, $datas){ | |
$response = []; | |
function TypingMessage(){ | |
if(typeof(window.Typing) == 'undefined' || window.Typing == null){ | |
console.log("Dispara Evento Escrevendo"); | |
window.Typing = new TypingTimer(function(){ | |
console.log("Dispara Evento Escrevendo"); | |
<?php | |
/* | |
Dependencies: https://www.php.net/manual/pt_BR/mongodb.tutorial.library.php | |
*/ | |
define("ACCESS_KEY", "cBeISKzsafdrSeISKzpmOOaJ8t8WISKzpYEOOE"); //Define your access key to send | |
if(!isset($_GET['key'], $_POST['owner']) OR $_GET['key'] !== ACCESS_KEY){ | |
http_response_code(500); |
<?php | |
function remove_array_key($key, &$array){ | |
$result = array_key_exists($key, $array); | |
if($result){ | |
unset($array[$key]); | |
return $array; | |
} |
<?php | |
error_reporting(0); | |
set_time_limit(0); | |
ob_end_clean(); | |
$url = $_GET['url']; | |
if(isset($_SERVER['HTTP_RANGE'])) { | |
stream_context_set_default([ | |
'http' => [ |
Para mudar o tempo em que o pc irá suspender, altere o valor 7200
.
Para fazer o cálculo, faça:
Hora(s) x 60 x 60.
Exemplo: 1 x 60 x 60 = 3600
Depois de x Horas o pc irá suspender.
<?php | |
//bancos brasileiros | |
$bancos = array( | |
array('code' => '001', 'name' => 'Banco do Brasil'), | |
array('code' => '003', 'name' => 'Banco da Amazônia'), | |
array('code' => '004', 'name' => 'Banco do Nordeste'), | |
array('code' => '021', 'name' => 'Banestes'), | |
array('code' => '025', 'name' => 'Banco Alfa'), | |
array('code' => '027', 'name' => 'Besc'), | |
array('code' => '029', 'name' => 'Banerj'), |
<?php | |
$slug = slugit("thank you for visiting"); | |
echo $slug; | |
// returns: thank-you-for-visiting | |
?> |