Skip to content

Instantly share code, notes, and snippets.

View rickysullivan's full-sized avatar
💭
YavaScript fun times.

Ricky Sullivan Himself rickysullivan

💭
YavaScript fun times.
View GitHub Profile
@rickysullivan
rickysullivan / machine.js
Created September 22, 2020 10:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@rickysullivan
rickysullivan / machine.js
Last active August 13, 2020 12:21
Generated by XState Viz: https://xstate.js.org/viz
const repMachine = Machine(
{
id: "formWorkflowApp",
initial: "loggedOut",
states: {
loggedOut: {
on: {
"LOGIN.TAP": "loggedIn.idle",
},
},
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
const targets = {
AppOne: {
name: "App One",
},
AppTwo: {
name: "App Two",
},
};
export default ({ config }) => {
@rickysullivan
rickysullivan / index.js
Last active October 24, 2019 03:06
craco-less
const {
getLoader,
loaderByName,
removeLoaders,
throwUnexpectedConfigError
} = require("@craco/craco");
const CracoLessPlugin = require("craco-less");
const path = require("path");
product_id_for_member stock_amount title start_price
PR2-B 4 Enamel 28cm Pie Dish - B Grade $6.00
PR3 18 Enamel 24cm Pie Dish $10.00
PR4 3 Enamel 20cm Pie Dish $8.00
PR5 1 Enamel 16cm Pie Dish $5.00
PR7 13 Enamel 16cm Pudding Basin $10.00
PR8 19 Enamel 14cm Pudding Basin $8.00
PR9 35 Enamel 350ml Mug $4.00
@rickysullivan
rickysullivan / snippets.cson
Created November 25, 2016 03:32
Foundation for Emails - Snippets for Atom
'.text.html.basic, .text.html.handlebars':
'FE Horizontal Rule':
'prefix': 'hr'
'body': '<hr />'
'FE Button':
'prefix': 'button'
'body': '''<button>
$1
@rickysullivan
rickysullivan / hbs_if_helper.js
Last active December 20, 2017 02:59
Handlebars If helper.
Handlebars.registerHelper("if", function (expression, options) {
try {
if (expression.split(' ').length == 1 && (!/@(\w+)/.test(expression))) {
if (options.data.root[expression] && !!(options.data.root[expression])) {
return (options.data.root[expression]) ? options.fn(this) : options.inverse(this);
} else {
return options.inverse(this);
}
} else {
return Handlebars.helpers["x"].apply(this, [expression, options]) ? options.fn(this) : options.inverse(this);
import { Component, OnChanges, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'ng-star-rating',
templateUrl: 'app/shared/star.component.html',
styleUrls: ['app/shared/star.component.css']
})
export class StarComponent implements OnChanges {