// app.js or where-ever 'app' and 'express' vars are assigned
const
fs = require('fs-extra'),
path = require('path'),
marked = require('marked');
// Web site is in ./www from this js file
const commonSiteDir = __dirname +'/www';
/** | |
Mark up code document at the given `codeUrl` into the div `domelement` | |
using the optional option overrides and optional callback. | |
Callback signature is (err, out) - where `out` is the structure defined | |
in [markupcode.js](../src/markupcode'js). | |
The getCodeUrl function allows testing on localhost (ie: leaves the | |
url untouched). If the server is not localhost will change url to | |
go to GitHub for the raw source to mark up. |
Before accepting Pull Requests to PotOfCoffee2Go fork of node-red-contrib-alasql
a review of the updates will be performed.
The review will be done by installing changes locally, kick-the-tires, and upon acceptance will be submitted to https://github.com/AlaSQL/node-red-contrib-alasql for merging into the next production release.
Currently, nodes developed under node-red do not have a system of test verification - such as mocha, jasmine, etc. The best that can be done at this time, is to build a node-red test suite of flows that test the modifications. No updates will be accepted by PotOfCoffee2Go without a set of accompanying node-red flows which test the changes.
The reviewers will integrate the flows into what will become a standard set of test flows to be approved by the maintainers of the official production release of node-red-contrib-alasql
AlaSQL,
It is handy to be able to quickly create a git repo server with anonymous clone and push access rights.
Note: Anyone!! with access to the server will be able to clone and push to the repo
Is super handy for personal use, in-house networks, or networks behind a firewall where security
is less of an issue.
Create the server git directory
Create a test repo
Bring up the git server daemon
GistBtns = { | |
// Used to lookup language based on file extension and render highlighting | |
const prism = new PrismLookup; | |
function tinyOcto() {return `${Spinner.octocat}`.replace('"48" height="48"','"24" height="24"')} | |
const gistid = '8014cc196d580699feab787abc9398a0'; // My Gist for these examples | |
let buttons = []; | |
buttons[0] = html`<button class="bttn pill" style="margin-left: 2em;">Markdown gist</button>`; | |
buttons[0].onclick = async () => { |
/* | |
Create empty directory | |
From command line | |
* note to self: nvm use 10 | |
npm init -y | |
npm i fs-extra --save | |
npm i node-fetch --save | |
npm i download-cli --save |
/* | |
Persist values between web pages in localstorage | |
Handles data objects to any depth | |
usage: | |
let store = new Store; | |
let value = store.db.path.to.field.value; | |
store.update = {section: {field: value}}; | |
*/ | |
class Store { | |
constructor() { this.init(); } |
/* | |
Allows coloring linux console text with nodejs. | |
Color codes are loaded into a table of 8 rows | |
with each row containing 64 columns. | |
Examples: | |
Save this file as 'colorconsole.js' | |
then run 'node ./colorconsole.js' | |
Usage: |
See the RLE section for definition of RLE format.
This class expects the (extended) RLE input to be correctly formatted. It is a two state parser, thus multi-state RLE will not parse properly.
The output this.pattern
is a string with spaces(dead)/zero(alive)
with lines separated by '\n'.