Skip to content

Instantly share code, notes, and snippets.

View Potherca's full-sized avatar
I wonder what this button does…

Ben Peachey Potherca

I wonder what this button does…
View GitHub Profile
Potherca /
Last active November 14, 2023 13:58
Scrum commitment

Each artifact contains a commitment to ensure
it provides information that enhances transparency
and focus against which progress can be measured:

  • For the Product Backlog it is the Product Goal.
  • For the Sprint Backlog it is the Sprint Goal.
  • For the Increment it is the Definition of Done.
Potherca /
Last active November 14, 2023 13:51
"Incremental" vs. "Iterative"
Potherca / example.js
Created October 13, 2023 14:11
set search params on an URL in javascript
const url = new URL(document.location)
const search = new URLSearchParams()
const options = {
"foo": "hello",
Object.entries(options).forEach(([key, value]) => {
Potherca / jwk_with_phpseclib_test.php
Created July 17, 2023 10:28 — forked from sicet7/jwk_with_phpseclib_test.php
Use JWK from JSON with the lcobucci/jwt library through phpseclib. Credit to @whatTool for helping with the implementation
//"phpseclib/phpseclib": "^3.0"
//"lcobucci/jwt": "^5.0"
require_once __DIR__ . '/vendor/autoload.php';
$json = '{
"keys": [
Potherca /
Last active October 13, 2023 13:11
An automated HTML element overview page.

HTML Element Reference

There are some great resources out there that document HTML elements.

Such as HTML Elements on MDN and

However, for me, most of these resources are either too exhaustive (like MDN) or too brief (like

What I want is a list of all available HTML elements, to get an idea of what the element is, without having to click through to another page. But also with enough information to know what the element is used for and how it is used.

Creating a real UUIDv4 in JS usually requires a library. The new can be used in the browser.

But how hard is it to create a valid UUIDv4? As it turns out, not very!

The following is all that is needed for a version 4 UUID (including correctly setting the so called M and N bits):

const generateUUID = () => "10000000-1000-4000-8000-100000000000".replace(/[018]/g, s => (s ^ Math.random() * 256 & 15 >> s / 4).toString(16));

This can be seen in action at

Copy Button

This gist contains the recipe to make a copy button.

It is activated by adding data-js="copy" to an element and including the CSS and JS files.

<link rel="stylesheet" href="">
      <script async src=""></script>
Your Text Goes Here

It used to be hard to Base64 encode an image. Most often, a server-side component was used.

Nowadays, with FileReader readAsDataURL it can be easily done, 100% in the browser.

    const file =  // the contents of the image goes here

    const reader = new FileReader();

    reader.onload = (event) => {
Potherca /
Last active August 29, 2023 14:36
Five laws of l̶i̶b̶r̶a̶r̶y̶ ̶s̶c̶i̶e̶n̶c̶e̶ software applications.

Five laws of library science

[The Five laws of Library Science][1] is a theory that S. R. Ranganathan proposed in 1931, detailing the principles of operating a library system.

  • Books are for use.
  • Every person his or her book.
  • Every book its reader.
  • Save the time of the reader.
  • A library is a growing organism.
Potherca / Basic Nextcloud server on
Last active September 30, 2022 08:11 — forked from michielbdejong/Basic Nextcloud server on Ubuntu
Steps to setting up a Nextcloud server from scratch using an Ubuntu-based VPS