Go to wherever you want to run this.
mkdir privatechain
cd privatechain/
touch genesis.json
mkdir data
// src/utils/CacheCollection.js | |
/** | |
* Creates a collection of unique values in local storage | |
* Works with arrays only | |
* Singleton method to allow sharing between classes without adding extra stuff | |
*/ | |
class CacheCollection { | |
constructor (key, expire=1200) { | |
this.key = key; | |
this.expire = expire; |
// From https://www.sitepoint.com/cache-fetched-ajax-requests/ | |
// All credits to: Peter Bengtsson | |
// Added Content-type to headers so it can go to traditional validation like fetch does | |
// Add some debugging messages: activate with { verbose: true } | |
// Add a request to be able to add headers instead of just calling URL | |
const CachedFetch = (url, options) => { | |
let expiry = options.seconds || 5 * 60 // 5 min default | |
let logger = (options.verbose) ? console.log : function(){}; |
const fs = require('fs-extra'); | |
const methods = {}, priv = {}; | |
// Private methods to do string replacement. Not optimized and cummulative trying to keep it simple. | |
// far better options here: https://stackoverflow.com/questions/5069464/replace-multiple-strings-at-once | |
priv.replaceObj = function(value, vars) { | |
let obj = value; | |
Object.keys(obj).forEach(function(item) { | |
obj[item] = priv.replaceStr(obj[item], vars); | |
}); | |
return obj; |
// hard disk holder | |
module stand( | |
wall=3, | |
height=20, | |
dw=20, | |
dd=80 | |
) { | |
wall2 = wall*2; |
// http://www.teacherschoice.com.au/Maths_Library/Trigonometry/triangle_given_3_points.htm | |
const triangle = { | |
corners: {}, | |
angles:{}, | |
sides: {}, | |
create: function (a,b,c,d,e,f) { | |
this.corners.A = [ a, b ], | |
this.corners.B = [ c, d ], | |
this.corners.C = [ e, f ] | |
return this; |
0x0a47bDaf1b1FD7E79273e286717Cb001cc05Bc48 |
I tried to run https://dev.to/andraconnect/augmented-reality-in-10-lines-of-html and https://github.com/jeromeetienne/ar.js from my own computer and got the following error:
Can't access user media :()
This error comes from:
https://github.com/jeromeetienne/jsartoolkit-experiments/blob/master/basic.html Line 100: navigator.getUserMedia
/* FROM LESS */ | |
svg.clock { | |
background: #ffffff; | |
width: 120px; | |
height: 120px; | |
/* Don't define height - not overridable */ | |
fill: none; | |
/* time markers */ | |
/* Clock face and center */ | |
} |
{ | |
"fileExtensions": [".less", ".css"], | |
"excludedFiles": ["src/less/*.less"], | |
"spaceAfterPropertyColon": { | |
"enabled": true, | |
"style": "one_space" // Comments are allowed | |
}, | |
"maxCharPerLine": 999999, | |
"spaceAfterPropertyColon": "no_space", | |
"urlQuotes": false, |