What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-20 02:53:02
using server passed values and client js together in ejs
<% var test = 101; %> // variable created by ejs <script> var getTest = <%= test %>; //var test is now assigned to getTest which will only work on browsers console.log(getTest); // successfully prints 101 on browser </scrip... Add solution -
Javascript 2021-09-19 23:54:03
playSound in draw loop javascript
createjs.Sound.on("fileload", handleLoad);createjs.Sound.registerSound("sounds/youraudio.mp3", "myID", 3); function handleLoad(event) { createjs.Sound.play("myID"); // store off AbstractSoundInstance for contr... Add solution -
-
Other 2021-09-17 20:31:02
typescript tsconfig.json file
{ "compilerOptions": { "module": "esnext", "target": "es2016", "jsx": "react-jsx", "strictFunctionTypes": true, "sourceMap": true, "ou... Add solution -
Javascript 2021-09-17 14:09:02
how to handle all error of all router in express
// development error handler // will print stacktrace if (app.get('env') === 'development') { app.use(function (err, req, res, next) { res.status(err.status || 500); res.render('error.ejs', { message: err.message, ... Add solution -
Javascript 2021-09-17 12:06:02
write buffer to file in node
/* Using nodejs' fs module you can create a WriteStream to handle raw stream of bytes and buffers. */ const path = "path/to/the/file"; array = BigInt64Array(0); buffer = Buffer.from(array.buffer) fs.createWriteStream(path).write(buffer); Add solution