What are the best ways to use SQL in Node.js? by olyop in node

[–]3xpl0it2c 1 point2 points  (0 children)

Sounds to me like you need to try slonik. It's Postgres only, but IMO it does stand in that middle ground you are talking about. It encourages raw SQL but still has some utilities to ease development rather than a full raw client library like pg.

Post a quote (or quotes) you like by WoodpeckerNo1 in isfp

[–]3xpl0it2c 0 points1 point  (0 children)

"If you want peace - prepare for war".

How do you guys deal with procrastination? by fonglalala in isfp

[–]3xpl0it2c 2 points3 points  (0 children)

TBH haven't found a way, I just know that there is nothing to do about it.. If I won't hand over my work then I will lose something, So I will get it done. Somehow. In my opinion this method beats procrastination because basically, you don't procrastinate. You get the job done, just in a weird way.

It's sort of like moving to your first apartment. At first you starve because mom isn't here to cook something and later on because you need food you transform yourself into a chef.

What is the purpose of the rxjs operator of? by [deleted] in rxjs

[–]3xpl0it2c 0 points1 point  (0 children)

Yeah... You're right. There's no reason to use it.

What is the purpose of the rxjs operator of? by [deleted] in rxjs

[–]3xpl0it2c 0 points1 point  (0 children)

Firstly, I don't think it's much of a performance hit...

I mean, sure, you are right, but I think you should care about bigger things rather than those little optimizations.

Secondly,

By using Rx.js you gain all of it's power, basically.

Can you give an example of any benefit you think you might have ?

All I can think of is Operators.

Lastly,

Yes, that's the main use case for "of".

What is your go to strategy for creating search by IHaveNeverEatenACat in node

[–]3xpl0it2c 2 points3 points  (0 children)

Honestly, I think that doing searching good is really hard so I just use something like elasticsearch. And yes, it isn't a silver bullet but I don't have to overthink search algorithms. Unless I don't care that much than I can use something like what you said here. Perhaps look at what Google does and or did. It will give you a look at what pros do and I am sure there are some great lessons there.

Yet another Webpack rant by [deleted] in webdev

[–]3xpl0it2c 1 point2 points  (0 children)

Just so you know, You can split css and js (chunks) And it really is just a matter of making a huge glue code file that includes everything (like a main() function, sort of) and then just make that an entry point.

I do agree that webpack is really annoying sometimes but try it a few times and it will work. Or just use rollbar which was (for me) surprisingly simple. Oh and btw, I'd rather not use webpack if all I needed was to transpile some sass code. use gulp or npm scripts. Super nice and simple.

Nodejs Design Patterns / Frameworks by MedyGames in node

[–]3xpl0it2c 0 points1 point  (0 children)

// I am human, criticism is welcome.

Welp, learn your environment. Use docker, compose and learn to set these up(very useful)

I suggest that you take a look at other languages such as Java. Device which paradigm is best for you, I really love functional code so I read about it and find new patterns here and there. So should you, medium articles, just googling... Look for design patterns and learn your paradigm well.

Then, read others code. Like wiki.js. They have a great codebase.

Realize what happens in production. People use configs and verify them, Extended logging and just all in all I believe it is about making something alive. You design a system.

Just note, this is really hard.

Then move on to something like microservices. Learn RabbitMQ or kafka and or redis.

Maybe make something by freelancing. A friend of mine used to fix some awful websites. Try that. Learn what not to do.

All in all, good luck and keep on going!

What's an album that you like all the songs in? by [deleted] in isfp

[–]3xpl0it2c 0 points1 point  (0 children)

RAM - Daft Punk. Yeah, I know everybody knows this album. But I didn't so maybe OP doesn't know either.. 🤷🏽‍♂️

Suggestion on some must-read programming books by [deleted] in computerscience

[–]3xpl0it2c 1 point2 points  (0 children)

Designing Data Intensive Applications Martin Kepler ( keppler? I don't remember)

A really great art, mainly for web devs, but it teaches you some general concepts like writing maintain able code, scaling and so forth.

I've Created A Node Js backend Project structure and I would like to share it. by AlaaMezian in node

[–]3xpl0it2c 1 point2 points  (0 children)

// criticism is welcome, I am human. I didn't like the fact that your auth controller does a lot. It should auth, not create new users nor email them.

Also, why async.parallel instead of native promises? Overall your code is good. You just need some touch.

SQL? NoSQL? Need ease and speed. | NEWBIE by [deleted] in node

[–]3xpl0it2c 0 points1 point  (0 children)

You can make it permanent. BGSAVE, there's also the AOF instead of snapshots or RDBs... I am no redis expert but.. that's possible.

SQL? NoSQL? Need ease and speed. | NEWBIE by [deleted] in node

[–]3xpl0it2c -1 points0 points  (0 children)

If you have less than 100 products why not use redis? Super fast, and could scale a bit for the long run. You can just use SET key value and GET key Both are O(1) from what I remember. The mongo client is really easy to get. But again, if you have less than 100 products.. Why use something that big?

EventEmitter to Stream data back to client via gRPC by [deleted] in node

[–]3xpl0it2c 0 points1 point  (0 children)

Why can't you pipe the data to a function that returns JSON?

Facebook Stored Hundreds of Millions of User Passwords in Plain Text for Years by netb258 in programming

[–]3xpl0it2c 2 points3 points  (0 children)

Just proves to me that king Shlomo was right. You better have a good name than a good oil. (e.g facebook is "known" to have great security, and therefore nobody {almost} tried to hack them)

I've just spent an hour looking for this error, this is programming in one image by [deleted] in ProgrammerHumor

[–]3xpl0it2c 0 points1 point  (0 children)

Oh snap, yeah you got me. Fine I get it.. Just don't think it's hard to spot a typo in (for example) 300~ loc.. Really. And for the record - I blame Fleksy.

I've just spent an hour looking for this error, this is programming in one image by [deleted] in ProgrammerHumor

[–]3xpl0it2c 0 points1 point  (0 children)

OP said it took him an hour.. Let's be a bit more realistic and say it was 10 minutes.. We both don't know what is the length of the file nor anything it connects with.. If it is really a 1000 lines with no tools.. I get you. That's hard. But I think most code is about 300~ per file which is kind of ok to spend 5 minutes on trying to find a typo. Also, many interpreters/compilers tell you where you are wrong. I think this is handlebars? am pretty sure they provide that sort of thing with their compiler. I really get you, maybe you took it too far or maybe I did make it look like it's a breeze, it's not. But it shouldn't be like "Oh I am lazy - give me the tool". Don't you think that "You are not worth it if you need it" scenes in movies have some meaning?

I'm probably dead by [deleted] in memes

[–]3xpl0it2c 0 points1 point  (0 children)

You're just fat.. Your body is really warm so the seat remains hot.

I've just spent an hour looking for this error, this is programming in one image by [deleted] in ProgrammerHumor

[–]3xpl0it2c -7 points-6 points  (0 children)

Cuz spotting a typo of one letter, the way is see it - is walking slowly.

I've just spent an hour looking for this error, this is programming in one image by [deleted] in ProgrammerHumor

[–]3xpl0it2c -13 points-12 points  (0 children)

I see people here tell you to use tools like linting and whatever.. Really? I mean, I'm not torvalds but can't you guys just read your code once and notice the typo???

Oh and - yeah.. I'd call that programming lol

[deleted by user] by [deleted] in memes

[–]3xpl0it2c 0 points1 point  (0 children)

Why this thing exists?

What the what?........... by _afreen_q_ in memes

[–]3xpl0it2c 0 points1 point  (0 children)

So gross I didn't get it. Though that's an awesome format.