This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from "vue"; | |
// only import the icons you use to reduce bundle size | |
import "vue-awesome/icons/regular/play-circle"; | |
import "vue-awesome/icons/map-marker"; | |
import "vue-awesome/icons/phone"; | |
import "vue-awesome/icons/bars"; | |
import "vue-awesome/icons/times"; | |
import "vue-awesome/icons/chevron-up"; | |
import "vue-awesome/icons/chevron-down"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MATTER MACHINE | |
// =================== | |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TRAFFIC-LIGHT MACHINE | |
// =================== | |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v1 - probably incorrect machine | |
const lastQuestion = (context, event) => { | |
return context.ques > 0 | |
} | |
const quizMachine = Machine({ | |
id: 'quiz', | |
initial: 'idle', | |
context: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Validate answer | |
* @param ctx | |
* @param evt | |
*/ | |
const validateAnswer = (ctx, evt) => | |
new Promise((resolve, reject) => { | |
if (evt.type === "ANSWER" && evt.answer?.selectedOption !== undefined) { | |
resolve(evt.answer); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'asciidoctor-pdf' | |
class CustomPdfConverter < Asciidoctor::PDF::Converter | |
register_for 'pdf' | |
# Customize the title page layout | |
def layout_title_page(doc) | |
start_new_page | |
font 'Helvetica', size: 48, style: :bold | |
text doc.doctitle, align: :center, valign: :center |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TOCHelpers | |
# Method to convert integers to Roman numerals | |
def to_roman(num) | |
romans = { | |
1000 => 'M', 900 => 'CM', 500 => 'D', 400 => 'CD', | |
100 => 'C', 90 => 'XC', 50 => 'L', 40 => 'XL', | |
10 => 'X', 9 => 'IX', 5 => 'V', 4 => 'IV', 1 => 'I' | |
} | |
result = '' |