Skip to content

Instantly share code, notes, and snippets.

View fritsvt's full-sized avatar
🔥

Frits fritsvt

🔥
View GitHub Profile
<!DOCTYPE html>
<html>
<body>
<h2>Request With a Callback Function voorbeeld</h2>
<button onclick="clickButton()">Haal token op</button>
<p id="response"></p>
// NIKS 18 leeftijd controle.
document.title = 'NIKS 18!';
const age = prompt('Wat is uw leeftijd?');
if (age < 18) {
// De gebruiker is jonger dan 18
alert('NIKS 18!');
} else {
// De gebruiker is 18 of ouder
<!DOCTYPE html>
<html>
<head>
<title>Voorbeeld</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Staat de onderstaande tag op de goede positie? -->
<img src="https://ihate.space/AX6p91I.gif" alt="beschrijving">
</head>
<body>
<p>html body</p>
<!DOCTYPE html>
<html>
<head>
<title>FilePond from CDN</title>
<!-- Filepond stylesheet -->
<link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet">
<!-- image preview -->
<link href="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css" rel="stylesheet">
</head>
Validator::extend('youtube', function ($attribute, $value, $parameters, $validator) {
return preg_match("/(youtube.com|youtu.be)\/(watch)?(\?v=)?(\S+)?/", $value);
}, "Sorry, this doesn't look like a valid youtube URL");
// Make sure to put this at the top of your AppServiceProvider: use Illuminate\Support\Facades\Validator;
Validator::extend('youtube', function ($attribute, $value, $parameters, $validator) {
preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $value, $matches);
return count($matches) > 0;
}, "Sorry, this doesn't look like a valid youtube URL");