This document describes the business rules that generate quotes and pricing for the fence configurator system. The system calculates prices based on fence specifications, materials, beams, gates, and accessories.
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
[ | |
{ | |
"op": "add", | |
"path": "/builders/textures/-", | |
"value": { | |
"id": "lshape", | |
"name":"lshape", | |
"imageUrl": "https://picsum.photos/512", | |
"repeat":{"x":1,"y":1}, | |
"rotation": 3.14159 |
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
window.d = 2; | |
Algebra(d,0,1,()=>{ | |
var point = (x,y)=>!(1e0 + x*1e1 + y*1e2), | |
// return functions instead of values, so they update when you drag the points | |
linesFromPoints = ps => ps.map((p,i,a) => ()=>p & (a[(i+1)%a.length]||a[0])), | |
pointsFromLines = e => e.map((ev,i,a) => ()=> ev * (a[(i+1)%a.length]||a[0])), |
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
class CVector { | |
constructor(components = []) { this.components = components; } | |
get lengthSquared() { return this.components.reduce((p, c) => p + c * c); } | |
get length() { return Math.sqrt(this.lengthSquared); } | |
get normalized() { return new CVector(this.components.map(x => x / this.length)); } | |
get sum() { return Math.sum(this.components); } | |
add(other, missingComponentValue = 0) { return this._zip(other, (a, b) => a + b, missingComponentValue); } | |
sub(other, missingComponentValue = 0) { return this._zip(other, (a, b) => a - b, missingComponentValue); } | |
mul(other, missingComponentValue = 1) { return this._zip(other, (a, b) => a * b, missingComponentValue); } | |
div(other, missingComponentValue = 1) { return this._zip(other, (a, b) => a / b, missingComponentValue); } |
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
const TokenExpressions = { | |
comment: /^((\/\/[^\n]+)|(\/\*[^(\*\/)]+)\*\/)/, | |
strings: /^("(\\"|[^"])*")/, | |
multiline_strings: /^(`[^\`]+`)/, | |
whitespace: /^([\s\n\r]+)/, | |
brace: /^[\(\)]/, | |
curlyBrace: /^[\{\}]/, | |
array: /^[\[\]]/, | |
comma: /^\,/, | |
operator: /^(\+|-|\*|\/|=|>|<|>=|<=|&|\||%|!|\^|)/, |
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
// Quick hack: Redirect to asset by URL - Endpoint extension for directus.io | |
// ========================================================================= | |
// | |
// 2021 - ToJans - Public Domain | |
// | |
// *** Don't hold me liable if it breaks anything! Quick hack, might expose all your data! | |
// | |
// You can use this endpoint extension to access assets via the folder and file structure | |
// you used in the file module, so you don't need to reference assets by guid anymore. | |
// |
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
Hello world! |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
/** | |
Chess: potential moves etc by @ToJans | |
Spiked in a couple of hours of late-night code for a tweet by @gregyoung | |
https://twitter.com/gregyoung/status/1385285718113722374 | |
The initial spark for Virtual Sales Lab was conceived during a late-night dinner with one of my business mentors.
The exquisit but now defunct restaurant Margaretha's in Oudenaarde/Belgium was where it all happened
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
class MyConverter : Newtonsoft.Json.Converters.CustomCreationConverter<IDictionary<string, object>> | |
{ | |
public override IDictionary<string, object> Create(Type objectType) | |
{ | |
return new Dictionary<string, object>(); | |
} | |
public override bool CanConvert(Type objectType) | |
{ | |
// in addition to handling IDictionary<string, object> |
NewerOlder