This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function checkVowel($word){ | |
$check = preg_match_all('/[aeiou]/i',$word,$matches); | |
if($check > 0){ | |
return true; | |
}else{ | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$source = file_get_contents('https://fangj.github.io/friends/season/0101.html'); | |
$source = strip_tags($source); | |
function captureWords($content, $dictionary){ | |
$limit_str = strlen($content); | |
$last_word = ''; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Future<void> prioridade() async{ | |
for (int i = 0; i < 55; i++) { | |
print('hello ${i + 1}'); | |
} | |
} | |
Future<void> esperando() async{ | |
await prioridade(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$realm = 'Área restrita'; | |
//usuário => senha | |
$users = array('admin' => 'mypass', 'guest' => 'guest'); | |
if (empty($_SERVER['PHP_AUTH_DIGEST'])) { | |
header('HTTP/1.1 401 Unauthorized'); | |
header('WWW-Authenticate: Digest realm="'.$realm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Consumo API com curl</title> | |
</head> | |
<body> | |
<?php | |
$url = "https://swapi.co/api/people/?page=2"; | |
$ch = curl_init($url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Base | |
$header = '{}'; | |
$payload = '{}'; | |
$signature = hash_hmac('sha256', $header.'.'.$payload, 'chave_privada', true); | |
//echo $header.'.'.$payload.'.'.$signature; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// créditos: https://pt.stackoverflow.com/questions/231970/verificar-se-a-p%C3%A1gina-html-existe-html-javascript | |
$.ajax({ | |
url: "http://meusite.com", | |
type: "HEAD" | |
}).done(function () { | |
alert('Online'); | |
}).fail(function () { | |
alert('Provavelmente offline'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Fórmula https://pt.wikipedia.org/wiki/F%C3%B3rmula_de_Haversine | |
// No stack https://pt.stackoverflow.com/questions/23533/calcular-distancias-entre-duas-coordenadas | |
function distancia($recebeCasaLat, $recebeCasaLon, $lat1, $lon1, $lat2, $lon2, $lat3, $lon3 ) { | |
$recebeCasaLat = deg2rad($recebeCasaLat); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<form action="recebe.php" method="POST"> | |
Escreva a mensagem: <input type="text" id="mensagem"> | |
<input type="submit" value="Enviar"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ionic.bundle.js:26799 Error: [$injector:unpr] Unknown provider: $Template1ServiceProvider <- $Template1Service <- Template1Ctrl | |
http://errors.angularjs.org/1.5.3/$injector/unpr?p0=%24Template1ServiceProvider%20%3C-%20%24Template1Service%20%3C-%20Template1Ctrl | |
at ionic.bundle.js:13443 | |
at ionic.bundle.js:17793 | |
at Object.getService [as get] (ionic.bundle.js:17946) | |
at ionic.bundle.js:17798 | |
at getService (ionic.bundle.js:17946) | |
at injectionArgs (ionic.bundle.js:17970) | |
at Object.instantiate (ionic.bundle.js:18012) | |
at $controller (ionic.bundle.js:23417) |
NewerOlder