Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
YavaScript fun times.

Ricky Sullivan Himself rickysullivan

💭
YavaScript fun times.
View GitHub Profile
View star.component.ts
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 {
@rickysullivan
rickysullivan / snippets.cson
Created Nov 25, 2016
Foundation for Emails - Snippets for Atom
View snippets.cson
'.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 Dec 20, 2017
Handlebars If helper.
View hbs_if_helper.js
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);
View current_trademe_stock.md
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
View index.js
const {
getLoader,
loaderByName,
removeLoaders,
throwUnexpectedConfigError
} = require("@craco/craco");
const CracoLessPlugin = require("craco-less");
const path = require("path");
View app.config.js
const targets = {
AppOne: {
name: "App One",
},
AppTwo: {
name: "App Two",
},
};
export default ({ config }) => {
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
const repMachine = Machine(
{
id: "formWorkflowApp",
initial: "loggedOut",
states: {
loggedOut: {
on: {
"LOGIN.TAP": "loggedIn.idle",
},
},
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions