Skip to content

Instantly share code, notes, and snippets.

@philwilliammee
philwilliammee / emailVerificationService.ts
Last active July 27, 2023 10:48
JWT-based email authentication middleware for Express.js
import SimpleEmailService from '../amazon/SimpleEmailService';
import { Express, Request, Response, NextFunction } from 'express';
import { sign, verify } from 'jsonwebtoken';
const simpleEmailService = new SimpleEmailService();
/**
* Middleware function to verify a JWT token.
*/
export async function verifyToken(
<div class="group-image field-group field-group-html-element box-shadow-inset sans">
<div class="time-line-overlay">
<div class="field field-name-field-featured emblem">
<span class="deco timeline-year">{{ field_year }}</span>
</div>
<div class="field field-name-field-image image">
{% if field_timeline_slide_link %}
<a href="{{ field_timeline_slide_link }}">
{{ field_timeline_slide_image }}
</a>
<main id="main" class="container-fluid aria-target" tabindex="-1">
<div class="row">
<article id="main-article">
<section>
<p class="intro">{{ body }}</p>
<h2>{{ title }}</h2>
<div class="cwd-component cwd-card-grid three-card home-stats">
<div id="fact1" class="card fast-fact">
<h3><strong class="stat"><span class="zmdi zmdi-graduation-cap"></span><span class="num" data-count={{ field_first_fact_count }}>...</span></strong> {{ field_first_fact }}</h3>
</div>
@philwilliammee
philwilliammee / D8_composer_lando_tooling.sh
Last active April 8, 2019 18:57
Creates a Pantheon updates multidev. Applies upstream updates and drush updates
# d8 composer this requires a updates multidev will throw an error if cant delete
# typical usage as tooling
# tooling:
# update:
# service: appserver
# description: "Creates a Pantheon updates multidev. Applies upstream updates and drush updates"
# cmd: curl -s -L https://gist.githubusercontent.com/philwilliammee/568f274c4e816b12527edee16789930f/raw/D8_composer_lando_tooling.sh | bash
# user: root
# or lando ssh --user=root && curl -s -L https://gist.githubusercontent.com/philwilliammee/568f274c4e816b12527edee16789930f/raw/D8_composer_lando_tooling.sh | bash
# add confirmation
/* CWD Card Slider (ama39, last update: 9/6/18)
Cutom Card slider to use with timeline (psw58, updated 3/1/19)
-
- Accessibility Notes:
- --
- Future Plans:
- -- Possible improvements in focus detection, ensuring that items are optimally visible when accessed by keyboard or screen reader
- -- Free Scroll Mode (disabling screen-by-screen locking, to allow the element to be freely scrolled with mouse or touch gesture)
------------------------------------------------------------------------- */
#!/bin/bash
if type -P git > /dev/null
then
echo "installing from repo"
git clone https://github.com/philwilliammee/react-mix-starter.git
cd react-mix-starter/
echo "removing remote url"
git remote rm origin
else
echo "Error: installation failed GIT is required"
.bootstrap *,.bootstrap *::before,.bootstrap *::after{-webkit-box-sizing:border-box;box-sizing:border-box;}
.bootstrap [tabindex="-1"]:focus{outline:0!important;}
.bootstrap ul{margin-top:0;margin-bottom:1rem;}
.bootstrap label{display:inline-block;margin-bottom:0.5rem;}
.bootstrap button{border-radius:0;}
.bootstrap button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color;}
.bootstrap input,.bootstrap button{margin:0;font-family:inherit;font-size:inherit;line-height:inherit;}
.bootstrap button,.bootstrap input{overflow:visible;}
.bootstrap button{text-transform:none;}
.bootstrap button,.bootstrap [type="submit"]{-webkit-appearance:button;}
#!/bin/bash
# credits
# https://help.github.com/articles/dealing-with-line-endings/
# https://intellij-support.jetbrains.com/hc/en-us/community/posts/205969644-How-to-Ensure-Always-LF-not-CRLF-on-Windows
echo "set git config to not overide LF on pull (windows only)"
git config --global core.autocrlf false
if [ -e .gitattributes ]
then
echo "Using local .gitattributes file"
# https://help.github.com/articles/dealing-with-line-endings/
git add . -u
git commit -m "Saving files before refreshing line endings"
# Remove the index and force Git to rescan the working directory.
rm .git/index
# Rewrite the Git index to pick up all the new line endings.
git reset
<!DOCTYPE html>
<html>
<head>
<style>
.animated .text{
list-style: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);