Skip to content

Instantly share code, notes, and snippets.

@BoDonkey
BoDonkey / password-reset-thoughts.md
Created September 14, 2022 19:14
password reset

TLDR; Basically you have to implement a button in Vue that when click redirects to a page that collects the users email and checks they exist. Then you generate a (time-sensitive?) code you send them by email. That email redirects to a third page which collects and error sniffs the new password. If it checks out, the password is changed or an error is thrown.

Within an a2 project, the password reset code is primarily in node_modules/apostrophe/lib/modules/apostrophe-login. There is code in the index.js file, plus several HTML pages in the views folder of that folder. The passwordResetRequest.html file is a form for requesting a password change.

@BoDonkey
BoDonkey / docker.md
Created September 14, 2022 14:23
Building Docker images for Apostrophe

Building Docker images for Apostrophe projects

Docker is a containerization platform that lets developers build an image for their projects and then run it anywhere. This guide is for production, not development. If you want to use Docker as a development environment, you can explore using a persistent Docker volume for your project, but bear in mind that commands like npm install can be very slow in such a configuration.

The initial steps of this guide will assume that you will be hosting your database, project, and uploaded assets on the same server. The second part will outline steps for configuring to use the AWS S3 service for hosting assets. Finally, the third portion will provide guidance for using the MongoDB Atlas multi-cloud database.

Creating the image

Install Docker

Docker can be installed on Mac, Windows, and Linux machines with either a CLI interface or using the Docker Desktop application, which acts as a graphical interface to the Docker engine. For this

@BoDonkey
BoDonkey / javascript-proxy-as-rest-client.js
Created February 8, 2022 10:42 — forked from DavidWells/javascript-proxy-as-rest-client.js
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
return async function(id = "") {
const response = await fetch(`${url}/${key}/${id}`)
if (response.ok) {
return response.json();
@BoDonkey
BoDonkey / functions.php
Last active March 7, 2019 11:29
Remove the 'Divi' post status
/**
* Remove 'Divi' from post states.
*
* @param array $post_states Existing post states.
* @param object $post Current post object.
*
* @return array
*/
function divi_removal_filter( $post_states, $post ){
// Make sure that $post_states is an array. Third party plugin might modify $post_states and makes it null which can create issues
@BoDonkey
BoDonkey / check.jsx
Created September 29, 2018 13:42
jsx for detecting change in checkbox
/ External Dependencies
import React, { Component } from 'react';
// Internal Dependencies
import './style.css';
class HelloWorld extends Component {
static slug = 'adna_hello_world';
<?php
class ADNA_HelloWorld extends ET_Builder_Module {
public $slug = 'adna_hello_world';
public $vb_support = 'on';
protected $module_credits = array(
'module_uri' => '',
'author' => '',
@BoDonkey
BoDonkey / module.php
Created May 8, 2018 20:38
Responsive field code
//field
'horizontal_line_width' => array(
'label' => esc_html__('Horizontal Line Width', 'diti-divi-timeline'),
'type' => 'range',
'option_category' => 'layout',
'description' => esc_html__('Here you can set a width for the Horizontal Line.', 'diti-divi-timeline'),
'toggle_slug' => 'main_settings',
'mobile_options' => true,
'responsive' => true,
@BoDonkey
BoDonkey / SCSS.md
Created July 17, 2017 10:23 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@BoDonkey
BoDonkey / demo.css
Created July 9, 2017 12:35 — forked from CodeMyUI/demo.css
SVG CSS3 Menu / Burger Button
*, *:before, *:after {
box-sizing: border-box;
}
body {
background: #158fef;
padding: 40px;
}
h4 {
@BoDonkey
BoDonkey / Contract Killer 3.md
Created June 11, 2017 15:08
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post