Skip to content

Instantly share code, notes, and snippets.

@barryosull
barryosull / dnd-prototype.html
Last active October 15, 2022 00:31
DND prototype I made for my first DM session
<html>
<head>
<title>Dnd - Lost mines of Phandelver</title>
<style type="text/css">
body {
margin: 0 10px;
font-family: Arial;
background-color: darkgreen;
}
@barryosull
barryosull / index.php
Created February 28, 2020 10:32
PHPUnit Code Coverage Report of Web App
<?php
/**
How to run a code coverage report on a web page:
Simply put this code after the vendor require and before the rest of the calling logic.
(Assumes you have PHPUnit installed)
**/
require_once __DIR__ . "/../vendor/autoload.php";
@barryosull
barryosull / Stripe SCA: Charging Saved Card JS.js
Created July 9, 2019 12:30
There is a bug in the Stripe documentation. It gives an incorrect code example for trying to reuse an existing card. Here's the fix.
/**
* There is a bug in the Stripe SCA documentation for reusing saved cards.
* It gives an incorrect code sample for trying to reuse an existing card via Card Elements.
*
* The offending sample: https://stripe.com/docs/payments/cards/charging-saved-cards#submit-payment-automatic-confirmation
*/
/** It says to do this **/
cardButton.addEventListener('click', function(ev) {
stripe.handleCardPayment(
@barryosull
barryosull / typed-php-arrays.php
Created June 11, 2018 19:30
Typed PHP arrays via variadic function args
<?php
class TestObject
{
}
function onlyAcceptArrayOfTestObjects(TestObject ...$objects)
{
echo "Got ".count($objects)." TestObjects\n";