Skip to content

Instantly share code, notes, and snippets.

View mrdarrengriffin's full-sized avatar

Darren Griffin mrdarrengriffin

View GitHub Profile
@mrdarrengriffin
mrdarrengriffin / Spec.md
Last active December 22, 2023 11:16
WP Manager Docs

Overview

This document outlines the technical specification for the WP Manager project. It is intended to be a living document that will be updated as the project evolves.

Project Description

WP Manager (name likely to change during scoping phase) is a project that allows centralised management of WordPress websites alongside integrations with third-party services such as GitHub, Cloudflare, WPEngine and BitBucket.

There are a few core principles for this app:

  • "WP Manager" is to remain Open Source and will most likely be licensed under a Creative Commons license.
  • When interfacing with WordPress, it must use the WordPress REST API. No other form of communication is permitted (e.g. AJAX routes, direct database access, etc.). This is to ensure that the app conforms to the WordPress coding standards.
@mrdarrengriffin
mrdarrengriffin / README.md
Last active December 31, 2023 17:48
Password-based data encryption using PBKDF2 and AES-GCM - JavaScript class

Password-based data encryption using PBKDF2 and AES-GCM in JavaScript

Overview

This is an implementation I made for providing secure data encryption and decryption functionalities in JavaScript. It uses PBKDF2 for key derivation and AES-GCM for the encryption algorithm.

Features

  • Key Derivation: Utilizes PBKDF2 for generating secure encryption keys.
  • Unique Salt for Each Encryption: A unique salt is generated every time the encrypt method is used, enhancing security.
  • Encryption/Decryption: Implements AES-GCM for robust data encryption and decryption.
@mrdarrengriffin
mrdarrengriffin / new-johnston-medium.css
Created September 19, 2023 22:09
New Johnston Medium
@font-face {
font-family: johnston100-medium;
src: url(https://mrdarrengriffin.com/Johnston100-Medium.woff2) format("woff2"),url(https://mrdarrengriffin.com/Johnston100-Medium.woff) format("woff")
}
@mrdarrengriffin
mrdarrengriffin / fragment.glsl
Last active March 14, 2023 09:34
Mesh Shaders
#define MAX_POINTS 16
precision mediump float;
uniform sampler2D texture;
uniform vec2 points[MAX_POINTS];
uniform float s2[MAX_POINTS];
uniform vec2 w[MAX_POINTS];
uniform int npoints;
uniform int warp;
@mrdarrengriffin
mrdarrengriffin / wp-plugin-list.json
Last active January 25, 2023 09:48
wp-plugin-list.json
{
"info": {
"page": 1,
"pages": 1,
"results": 1
},
"plugins": [
{
"name": "Internal plugin example",
"slug": "contact-form-7",
@mrdarrengriffin
mrdarrengriffin / automations.yaml
Last active January 31, 2020 08:26
Example automation of Philips Hue Switch integration
- id: bedroom_brightness_on
alias: Brightness UP - Bedroom Switch
description: 'Brightness UP turns on Bed LEDs and Lamp when bedroom ceiling lights off'
trigger:
- entity_id: sensor.bedroom_switch
platform: state
to: 2_click_up
condition:
- condition: state
entity_id: light.bedroom_ceiling
@mrdarrengriffin
mrdarrengriffin / configuration.yaml
Last active January 30, 2020 21:31
Philips Hue Switch HACS Addon
# Used for the state of sensors
binary_sensor:
- platform: huesensor
# Used for the state of remotes
remote:
- platform: huesensor
# Used to relay the state of devices registered in the Hue app geofence
device_tracker:
@mrdarrengriffin
mrdarrengriffin / index.html
Last active January 24, 2023 23:11
Adorable Customizer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Adorable Avatar Configurator</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>🐪 Camel Case</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
<?php
Class MojangAPI{
private $db;
private $playersTable = "minecraft_player";
private $fetchInterval = 60;
public $using;