Skip to content

Instantly share code, notes, and snippets.

View gemmadlou's full-sized avatar

Gemma Black gemmadlou

View GitHub Profile
@gemmadlou
gemmadlou / howto.md
Last active January 2, 2018 17:04
Click-to-Share on Facebook
@gemmadlou
gemmadlou / nodejs-custom-es6-errors.md
Created January 16, 2018 14:11 — forked from slavafomin/nodejs-custom-es6-errors.md
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js

@gemmadlou
gemmadlou / highlightNav.js
Created February 21, 2018 14:57
My rubbish javascript code
/**
* @todo rewrite so logic is separated out and it's testable
* @todo Properly develop if time allows
*/
export const highlightNav = () => {
let scrollPos = window.scrollY;
let hashLinks = document.querySelectorAll('.js-hash-nav');
Array.from(hashLinks).forEach((link, index) => {
let nextElement = hashLinks[(index + 1)];
@gemmadlou
gemmadlou / 01-intro.md
Created February 22, 2018 10:18
Tech Talk - Intro To Domain Driven Design
@gemmadlou
gemmadlou / functions.js
Last active April 6, 2021 02:20
Dreaming Whilst Black
<script>
// Production steps of ECMA-262, Edition 6, 22.1.2.1
if (!Array.from) {
Array.from = (function () {
var toStr = Object.prototype.toString;
var isCallable = function (fn) {
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
};
var toInteger = function (value) {
@gemmadlou
gemmadlou / 01-introduction.md
Last active June 15, 2026 18:16
WordPress Composer Starter (Steps)

Develop WordPress as a Modern PHP Project with Composer


WordPress is popular because it's easy to setup without much technical know-how. However, to build a more robust PHP project with command line deployments, updates and ongoing maintenance, working with WordPress out-of-the-box raises specific challenges:


  • How can we make our WordPress projects portable between developers?
@gemmadlou
gemmadlou / 001-paswordless-authentication-express-js.md
Last active March 30, 2018 20:45
Passwordless auth with express js Journal

Passwordless Authentication With Express JS

This is a live write-up of how I build a passwordless authentication app. I'm trying to add each step, as trivial as they seem here for future reference, but maybe you'll find this useful too. I've written it as if it's for someone completely new to Express js and other programming paradigms. So skip if it's all familiar to you.

Why passwordless?

There are a few arguments for it, but primarily most apps don't need passwords. We're not handling financial information. And passwordless doesn't mean just walk in. The app sends an email to the recipients address. They log in by clicking a link in the email. With a traditional authentication app, they would have to reset their passwords via their email. Passwordless authentication just omits creating the password step.

Written as a journal to my future self

@gemmadlou
gemmadlou / 001-ubuntu-16-php-nginx-server.md
Last active April 29, 2018 12:57
Creating a new PHP Nginx Server Ubuntu 16.04
@gemmadlou
gemmadlou / readme.md
Last active April 5, 2018 13:48
Code Quality Checks