This file contains 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 path = require('node:path'); | |
const fs = require('node:fs'); | |
const assert = require('node:assert'); | |
const requireImpl = (pth) => { | |
assert((typeof pth) === 'string'); | |
let moduleText; | |
const modulePath = path.join(process.cwd(), pth); | |
try { | |
moduleText = fs.readFileSync(modulePath); |
This file contains 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
import path from 'node:path'; | |
import fs from 'node:fs'; | |
import http from 'node:http'; | |
const HTTP_PORT = 3000; | |
const STATIC_DIR = path.join(process.cwd(), './static'); | |
const fsExists = (filePath) => fs.promises.access(filePath).then(() => true, () => false); |
This file contains 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
openssl req -x509 -out localhost.crt -keyout localhost.key \ | |
-newkey rsa:2048 -nodes -sha256 \ | |
-subj '/CN=localhost' -extensions EXT -config <( \ | |
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") |
This file contains 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
# assuming you have pyhton 3.7-stretch | |
DIR=./ | |
git clone --branch tags/0.14.3 [email protected]:RasaHQ/rasa_core.git $DIR \ | |
&& cd $DIR | |
pip install pip==19.1 | |
pip install -r requirements.txt |
This file contains 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
from rasa_core.agent import Agent | |
from rasa_core.policies import KerasPolicy | |
from rasa_nlu.training_data import load_data | |
from rasa_nlu import config | |
from rasa_nlu.model import Trainer | |
import datetime | |
def _archive_name (type, environment): | |
t = datetime.datetime.now() | |
timestring = t.strftime('%Y%m%d-%H%M%S') |
This file contains 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 http = require("http"); | |
const path = require("path"); | |
const fs = require("fs"); | |
const busboy = require('connect-busboy'); | |
const express = require("express"); | |
const STORE_FOLDER = 'public'; | |
const app = express(); | |
app.use(busboy({ | |
highWaterMark : 2 * 1024 * 1024 // alot |
This file contains 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 audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
const noteMap = { | |
'90': { | |
key: 'Z', | |
note: 'C', | |
freq: 261.63 | |
}, | |
'83': { |
This file contains 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
export class Decoder { | |
getEmptyChunk () { | |
return { | |
name: '', | |
length: 0 | |
}; | |
} | |
readString (data, offset, length) { | |
return data.slice(offset, offset + length); |
This file contains 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 mapToType = (parent, depth = 2) => { | |
const map = (object, lvl = 0) => { | |
if (object instanceof Array) object = object[0]; | |
const props = {}; | |
for (let key in object) { | |
const prop = object[key]; | |
let type = typeof prop; | |
if (type === 'object') { | |
type = prop instanceof Array ? 'array' : 'object'; |
This file contains 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
$(document).ready(function() { | |
$("a[href^='#']:not([data-toggle='tab']").click(function() { | |
var anchor = $(this).attr("href"); | |
if ($(anchor).length != 0) { | |
$("html, body").animate({scrollTop: $(anchor).offset().top - ($('header').height()+10)}, 500); | |
} | |
return false; | |
}); | |
}); |
NewerOlder