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
| /db | |
| /plugins | |
| /uploads | |
| /logs |
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
| // requires the experimental v3 of transformersJS: | |
| // npm install xenova/transformers.js#v3 | |
| import { FeatureExtractionPipeline, pipeline } from "@xenova/transformers"; | |
| export interface Entry<T> { | |
| str: string; | |
| metadata: T; | |
| } | |
| export interface VectorizedEntry<T> extends Entry<T> { |
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
| /*------------------------ | |
| Libraries | |
| ------------------------*/ | |
| const axios = require("axios"); | |
| const fs = require("fs"); | |
| const FormData = require("form-data"); | |
| /*------------------------ | |
| Download the file. | |
| Good article on how to download a file and send with form data - https://maximorlov.com/send-a-file-with-axios-in-nodejs/ |
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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS 3D Physics</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| </head> | |
| <body> | |
| <script src="js/three.js"></script> |
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
| // long version | |
| function loadExt(files, after) { | |
| var _this=this; | |
| _this.files = files; | |
| _this.js = []; | |
| _this.head = document.getElementsByTagName("head")[0]; | |
| _this.after = after || function(){}; | |
| _this.loadStyle = function(file) { | |
| var link = document.createElement("link"); | |
| link.rel = "stylesheet"; |
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
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
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
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
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
| <html> | |
| <head> | |
| <script src="clmtrackr.js"></script> | |
| <script src="model_pca_20_svm.js"></script> | |
| <script src="p5.js"></script> | |
| <script src="p5.dom.js"></script> | |
| <script> | |
| var ctracker; |
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
| /* global createImageBitmap */ | |
| function loadImageWithImageTag(src) { | |
| return new Promise((resolve, reject) => { | |
| const img = new Image; | |
| img.crossOrigin = ''; | |
| img.src = src; | |
| img.onload = () => { resolve(img); }; | |
| img.onerror = () => { reject(img); }; | |
| }); |
NewerOlder