Skip to content

Instantly share code, notes, and snippets.

View dwaard's full-sized avatar

Daan de Waard dwaard

  • HZ University of Applied Sciences
  • Str:omsund, Sweden
View GitHub Profile
@dwaard
dwaard / StrongPassword.php
Created June 18, 2020 07:52
A strong password custom validation rule, based on Matt Kingshotts article: https://itnext.io/laravel-validation-rule-passwords-70364ae0f349
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class StrongPassword implements Rule
{
/**
* Create a new rule instance.
<?php
namespace App\Console\Commands;
use App\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
class CreateAdminCommand extends Command
{
@dwaard
dwaard / product_vision_board.md
Last active May 4, 2023 21:36
Example of a Product Vision Board in markdown

The Product Vision Board

👀 VISION To give music lovers better access to more artists
@dwaard
dwaard / Vector.ts
Last active November 19, 2021 14:18
Typescript class that represents a 2D Vector
/**
* This class represents a mathematical (Euclidian) Vector mainly used in
* physics and engineering to represent directed quantities. Basically it's
* responsible for holding a x- and y-coordinate, length and angle. It can also
* perform basic vector operations like adding, subtracting and scaling.
*
* The state of a vector object is immutable. This means that it is by design
* not allowed to change the internal state of the vector. The different
* computation methods that perform different computations like adding,
* subtracting, scaling and mirroring all return a new Vector object or just a
@dwaard
dwaard / rps.php
Created May 27, 2019 07:12
Simple Rock-Paper-Scissors game in PHP
<?php
//Now, let's play
$returnText = 'You have not played yet. Select your weapon and hit the Play button';
if (userHasValidSelection()) {
$userChoice = $_GET['userSelect'];
//Let the computer make a choice
$computerChoice = letComputerChoose();
//Now, let's play, and return the result text!
$returnText = "The server chose $computerChoice. ";
$result = compare($userChoice, $computerChoice);
// include the library code:
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
lcd.begin(16, 2);
lcd.print("program me daddy");
lcd.setCursor(0,1);
@dwaard
dwaard / template.blade.php
Created February 5, 2018 09:46
Template for a page in Laravel with AdminLTE plugin from JeroenNoten
@extends('adminlte::page')
@section('title', '[Title as shown in browser tab]')
@section('content_header')
<h1>Title as shown on top of page</h1>
@stop
@push('js')
{{-- place your javascripts here --}}
@dwaard
dwaard / object-array-demo.ts
Last active June 2, 2017 08:41
Voorbeeld over het werken met een verzameling objecten in Typescript
class Student
{
readonly studentnummer : number;
readonly volledigenaam : string;
constructor(nummer : number, naam : string)
{
this.studentnummer = nummer;
this.volledigenaam = naam;
}