Skip to content

Instantly share code, notes, and snippets.

nerfpops / printserver.js
Created Mar 11, 2016
Node Label Print Server for WASP WPL305
View printserver.js
import Rx from "rx"
import Printer from "zuzel-printer"
import mysql from "mysql"
function main () {
let printer = new Printer("labels")
let db = mysql.createConnection({
host : "abc",
View NustacheMetaData.cs
using System.Linq;
using Nustache.Core;
static ILookup<string, string> GetMetadata(string templateContent) {
// All metadata are written as {{! key: value }}. {{! ... }} is a comment in Mustache.
// This function uses the possibility to alter start and end delimiters to scan for {{! }}
// instead of {{ }}. With {{! as start delimiter, {{!! becomes a comment. I don't think
// you need comments in this case, but I think this is a neat way to include metadata in
// the templates.
return new Scanner("{{!", "}}")
View machine.js
const invoicePaymentStatusMachine = Machine({
id: 'invoice_payment_status',
initial: 'open',
states: {
open: {
on: {
PAY: 'paid',
CANCEL: 'cancelled',
UNCOLLECTIBLE: 'uncollectible'