Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info

    looking for filenames and size, where I am grouping all images types, and all video types

    str = fart.jpg 110b ok.zip 1b jk.png 1b

    I tried a few thigns
    oh shit there should be new lines after all those sizes
    (.+).(mp3 | aac | flac) (.)
    ^ tried that for video but no luck
    Raghav Garg
    Hello everyone,
    I wanted to understand about redis pub/sub. Say if I have a producer which publish messages on multiple channels.
    Now, should I create single subscriber and listen to all channel.
    or should I create individual subscriber for every channel?
    I want to understands what are the best practices..!
    this channel seems dead
    Miguel Espinoza
    @knostradamus there's #nodejs/node
    nikhil jain
    Hi currently we are using node 4.. on our production system and we are facing major cpu utilization issue.what happen is at some point of time it consume 100% cpu and stop accepting the request. we are struggling with from long time.we need a solution for this. anyone has any idea about it ?
    heyho guys how can i get all values and childs of one child in this case i need everything in "c" updated into another ref
    please help me im stuck here :/
    exports.updateRoom = functions.database.ref('/users/{pushID}/c').onWrite((change, context) => {
    Hitesh Joshi
    router.validateData = function(req, res) {
        let data = req.body;
        let redudantData = [];
        for (let i = 1; i < data.length; i++) {
            let number = data[i][6].toString();
                    { $match: { contactNumber: number}},
                    { $project: {
                        'name': 1,
                        'contactNumber': 1
                ]).exec(function(err, userData) {
                    if (err) {
                    } else if (userData.length == 0) {
                        console.log("No old user found for this number ");
                    } else {
                        // userData.rowNo = i;
                        // redudantData.push(userData);
        if (data.length - 1 == i ) {
    Hey, My response is fired before the loop end
    how I can send it after the loop is over
    I've used async await but it is also not working I don't know where is the problem is
    Thanks in advance

    @evoxtorm does it resolved?

    if (data.length - 1 == i ) {

    you need to put the above code in the for loop. Because variable i is undefined outside for loop. And one more thing also, you're using ==,
    whenever possible use === instead.

    Hitesh Joshi
    Thanks @Kishan08
    Hey can anyone tell me how I can use render a simple page which convert excel to table then validate the table and sends data to the database then again send data back to this page and show
    but I want to run the page after one of api is hit then the page show on the browser
    I've tried to use pug but I'm not able to do my javascript part in it
    any suggestions ???
    Jason Gladen
    I ran into an interesting issue: and I'm not even sure where to go.
    npm link will test intall the command line tool... and on windows everything works fine... except if paramerter contains and ampersand.. I have a workaround with double escaping & gets replaced with ^^^&
    so it looks like %* in the "BIN_NAME_HERE.cmd" batch file doesn't re-escape the command line arguments..
    I have not found a good document that covers %* "batch command substituions" maybe I have to use power shell instead..
    NodeJS -> any pointers on a library similar to Java Vert.X in the NodeJS world? .... Node/JS noob here
    Jeff Zucker
    A library of mine works if it is in one folder location but not another. It has no relative links. All of its dependencies are --saved ... any ideas on trouble-shooting?
    If I symbolic link to it, it works but if I copy it or npm install it, it does not.
    Good night guys, I'm new to the node and I'm looking for knowledge about it .. I'm preparing a Centos7 server for production and I would like to know if someone can pass me material on installation and configuration of server for nodejs.Thank you all.
    Abhishek Mathur
    Hi , I am having a issue, "Open dedicated DevTools for Node" no longer automatically detects when i run node --inspect index.js in webstorm terminal, it used to do but after my chrome got updated , then i installed yarn , it has happened
    the console still shows debugger attached
    Thanks in advance
    Abhishek Mathur

    Hi , I am having a issue, "Open dedicated DevTools for Node" no longer automatically detects when i run node --inspect index.js in webstorm terminal, it used to do but after my chrome got updated , then i installed yarn , it has happened
    the console still shows debugger attached
    Thanks in advance

    Used opera , works fine, still couldn't understand why , even chrome canary failed :)


    I'm trying to login to facebook, after successful login; am getting one notification popup asking for allowing and block. I'm fine with either case. I am using webstorm IDE framework cucumber.

    I have already tried browser.alertDismiss(), browser.alertAccept() none of them are working. could anyone help me in dealing with these notifications.

    Hey I am trying to use live server but seems to have this problem
    Error: listen EACCES: permission denied
    Miguel Espinoza
    @andihoxha more than likely you have another program already listening on port 8080, maybe even another instance of your own live server. If you are on linux you can find which program is using that port with lsof -i :8080
    any one help me to make webpack server for nodejs and reactjs server side rendering application !
    @samithn are you serious :) vertx was written to be like node.js in general - express is fine or koa 2.0
    Hi there! Wondering if someone could help me, I'm going crazy trying to find a solution.
    I have an async function that should return a Promise with a string, but it always returns undefined !
    Code in question:
    async function FetchAppGraph(AppID) {
    db.collection("Apps/" + AppID + "/{docIDs}")
    .then((doc) => {
    if (!doc.exists) {
    console.log("No graph available");
    return "NA";
    } else {
    return doc.data();
    .catch((err) => {
    return "ERR";
    Bernard Baker
    Hi everyone 👋 I'm using termux and I'm seeing a cross origin error. Any ideas?
    alaa almasri
    so im trying to learn react what is the best way to learn ???
    Adhikansh Mittal
    @bernibear2000_twitter Please check your API endpoint if you are deploy them on 2 different service or server then you have to use Cross origin resource sharing which you can enable in your code
    In node js by adding npm install cors
    In react js just add Allowed-Cross-origin:* while hitting any api any, it was usinf axios or http call
    alaa almasri
    guys can anyone help me with something
    alaa almasri
    guys I'm trying to build a node js project using OAuth and socket io so what's the best ideas for a project
    Who asks for idea. Make your own idea. Making others idea dont make you unique
    Nadir Abbas

    I am building a YouTube video trimmer, and currently, it takes the YouTube video ID, downloads the whole video from the server (Even it is like 10 hours long), and then it trims it according to user's inputted timeframe using ffmpeg.

    enter image description here

    Now the problem with this is that it takes so much time to download the whole video even if we want a small piece of it hence it is highly impractical.

    I was thinking to implement something like an HTML5 video player does when you seek the video forward. It just jumps to the part where you seek-ed to without downloading the part you skipped over. How can I only download a part of a video file from a server in form of a buffer and then generate an already trimmed video file from that? I don't know if that is even possible on the server-side, but video players do it on the client-side.


    Hi folks, im using validate from validate-typscript. Unfortunately, the schema I pass through the validator function varies

    When the validator fails, how can I print the element of the schema that isn't being validated?

    In my example, I passed a string to somthing that should have been a number. How can I say what isnt matching, instead of saying "the model is actually a duck"
    Rohit Pawar
    var express= require("express")
    var bodyParser=require("body-parser")
    var app= express()
    var http=require('http').Server(app)
    var io = require('socket.io')(http)
    var mongoose=require('mongoose')
    var port=process.env.PORT || 5000
    var dbUrl='mongodb+srv://user:*******@cluster0.jbbh5.mongodb.net/<dbname>?retryWrites=true&w=majority'
    var Message=mongoose.model('Message',{
    app.get('/messages', (req,res) =>{
        Message.find({},(err,messages) =>{
        var message=new Message(req.body)
        console.log('user connected')
    mongoose.connect(dbUrl,{useUnifiedTopology: true, useNewUrlParser: true},(err) =>{
        console.log('mongodb connection successfull')
    var server= http.listen(port, () => {
        console.log("Server is listening on port %d",port)

    above is js file

    <!DOCTYPE html>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
        <script src="https://code.jquery.com/jquery-3.5.1.min.js" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <link rel="shortcut icon" href="#">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script>
        <div class="container">
            <div class="jumbotron">
                <h1 class="display-4">Send Message</h1>
                <input  id ="name" class="form-control" placeholder="Name">
                <textarea  id ="message" class="form-control" placeholder="Message"></textarea>
                <button id="send" class="btn btn-success">Send</button>
            <div id="messages">
            var socket=io()
            $(()=>  {
                $("#send").click(() =>{
               var message={name: $("#name").val(),message: $("#message").val()}
            function addMessage(message){
                $("#messages").append(`<h4> ${message.name} </h4> <p> ${message.message} </p>`)
            function getMessages(){
            function postMessage(message){

    above is html file
    cannot access it pls help

    Rohit Pawar
       $("#messages").append(`<h4> ${message.name} </h4> <p> ${message.message} </p>`)
            function getMessages(){
    i want to channge these function to assync Function
    Miguel Espinoza
    @roh8t its usually better to post links to a pastebin instead of pasting the entire file here. There are many but github gists and pastebin.com are popular options. Why do you want to change those functions to be async?
    alaa almasri

    I am using loopback 4 for backend and react for front end.
    when I make a request on API, it gives me blocked Cors.

    I tried this :
    let config = {
    mode: 'cors',
    cache: 'no-cache',
    credentials: 'same-origin',
    headers: {
    'Access-Control-Allow-Origin': '*',
    'Content-Type': 'application/json',
    redirect: 'follow',
    referrerPolicy: 'no-referrer',
    const response = await axios.post(${API}/signUppatient, obj, config);
    but it didn't work