Skip to content

Instantly share code, notes, and snippets.

View ifyoumakeit's full-sized avatar
:octocat:
Githubbin’

Dave Garwacke ifyoumakeit

:octocat:
Githubbin’
View GitHub Profile
@ifyoumakeit
ifyoumakeit / templatejs.js
Last active March 19, 2018 17:23
Quick JS templating with string template literals
const resolveExpression = exp => {
const resolved = typeof exp === "function" ? exp() : exp;
return Array.isArray(resolved)
? resolved.join("")
: typeof resolved !== "undefined" ? resolved : "";
};
const html = (strings, ...exps) => {
return strings.reduce((acc, str, i) => {
return `${acc}${resolveExpression(exps[i - 1])}${str}`;
Reach
Register
Login
processMobileNumber -> Is Returning User?
Is Returning User?
pass -> Search
fail -> Authentication
Authentication
processToken -> Is Token Valid?
Is Token Valid?
@ifyoumakeit
ifyoumakeit / machine.js
Last active February 17, 2020 00:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ifyoumakeit
ifyoumakeit / Reference.md
Last active April 21, 2020 11:27
Reference.md

alt replace alt

reference links

@ifyoumakeit
ifyoumakeit / github-conventional-comments.js
Last active February 8, 2025 19:19
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
todo: "todo",
question: "question",
thought: "thought",
@ifyoumakeit
ifyoumakeit / machine.js
Created August 25, 2020 21:04
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
const USER_TYPE = {
new_customer_hto: "new_customer_hto",
new_customer_rx_retail: "new_customer_rx_retail",
new_customer_rx: "new_customer_rx",
returning_customer_hto: "returning_customer_hto",
returning_customer_saved_expired_rx: "returning_customer_saved_expired_rx",
returning_customer_saved: "returning_customer_saved",
returning_customer_saved_expired_payment:
"returning_customer_saved_expired_payment",
returning_customer_saved_expired_rx_payment: