Skip to content

Instantly share code, notes, and snippets.

View geoffreycrofte's full-sized avatar
📚
Writing books

Geoffrey Crofte geoffreycrofte

📚
Writing books
View GitHub Profile
@geoffreycrofte
geoffreycrofte / block.js
Created December 10, 2022 17:42
Create a Gutenberg block using a shortcode for the front, and getting its parameter from the front panel
/**
* Code writen on the fly, I still need to test it.
* Use at your own risk 😁
*/
// Register the block with WordPress
registerBlockType('my-plugin/my-block', {
title: 'My Block',
icon: 'book',
category: 'common',
@geoffreycrofte
geoffreycrofte / 01-FormDataStore-class.js
Created December 10, 2022 17:54
JavaScript class that saves form input data to local storage, using the input element's ID attribute as the key, and providing methods for retrieving and populating the data:
/**
* Code Generated by an AI
* Never tested in production, the goal is to store it as Gist before I can try this in a real web project.
*/
class FormDataStore {
// Constructor function to set up the data store
constructor() {
this.data = {};
}
@geoffreycrofte
geoffreycrofte / Style.css
Created February 21, 2024 11:32
Atticus.io User Style - Custom styles for app.atticus.io
/* ==UserStyle==
@name atticus.io - 21/02/2024 12:31:00
@version 2.0.0
@description A user style for app.atticus.io
@author Geoffrey Crofte
==/UserStyle== */
.atticus-editor-container .editor-area .editor-textarea {
max-width: 80ch;
margin-inline: auto;