« first day (3088 days earlier)      last day (2084 days later) » 

10:18
I have this in my database and trying to use mongoose to find it, but I am doing something wrong because its not working, any ideas what Im missing?
{ _id: 5ca0924394cce407d8581623,
  url: 'https://www.example.com',
  short: 'g5857s',
  createdAt: 2019-03-31T10:11:15.038Z,
  updatedAt: 2019-03-31T10:11:15.038Z,
  __v: 0 }
app.get("/:short", (req, res) => {
  Data.find({ short: req.params.short }, data => {
    console.log(data.short);
  });
});
  getUrl = () => {
    fetch("http://localhost:3001/g5857s")
      .then(data => data.json())
      .then(res => console.log(res));
  };
10:36
Ohh, was missing error handling :) Working great now!
11:30
Is it somewhere april fools already?
The "Time Travel!" link is only one way, apparently
sadly :(
But you have a cookie called tm2019 that you can remove
And that would make it appear again
Hello
0
Q: Javascript: Need some time to execute

Chris PHere is my code: document.onkeydown = function(event){ switch(event.keyCode){ case 32: //space alert("Space pressed"); clearInterval(game_interval); game_status = "paused"; setTimeout(function(){ ...

lol
I feel so 1995 :P
11:49
0
Q: Comic Sans font is missing in Ubuntu

Madara UchihaUbuntu users are barred from experiencing the full glory of this year's April Fools prank, as it relies on Windows supplying the Comic Sans MS font used in headlines and several other places. This oppressive discrimination will not stand!

you know, it would be fun if the uk government came up with a brexit plan now, that is basically "as we can't decide things for ourselfs, in the wake of the referendum to leave the EU the EU will replace our government". That would be a more fun april fools than silly things you see nowadays.
Or the trump admistration who makes a statement that IS will be official recognized as party, and education will be changed so that everyone learns the sharia laws.
You know, a good april fools plays with irrational fears people have to show them a mirror how irrational those are. The silly things we see nowadays are way too tame.
12:29
Sorry, wrong port.. Ill stop asking stupid questions now :)
In the past the bbc made fun about alien invasions on public broadcast - those were amazing april fools jokes
"The application should remember searches between browser sessions."
What does that mean? Should it remember when closing the browser and opening it back up?
13:01
if anyone missed
<!--
                        HAPPY APRIL FOOL'S FROM STACK OVERFLOW

                      \/                    __/   .::::.-'-(/-/)
                             _/:  .::::.-' .-'\/\_`*******          __ (_))
                \/          /:  .::::./   -._-.  d\|               (_))_(__))
                             /: (""""/    '.  (__/||           (_))__(_))--(__))
                              \::).-'  -._  \/ \\/\|
                      __ _ .-'`)/  '-'. . '. |  (i_O
                  .-'      \       -'      '\|
13:37
that is gorgeous
13:47
Boy what the fuck
user8729657
My cursor has glitter :)
user8729657
Can I change my stack overflow to have a dark color?
@OvieAdese You can just click the time travel button and it would go away
user8729657
I meant, the white stackoverflow theme hurts my eyes making it hard to read things, I was wondering if there is a dark theme button like what Youtube has. @MadaraUchiha
@OvieAdese Oh, no. But you can install an extension called Stylus, which offers community-made skins for pretty much every large website
Beware: There is an extension called Stylish with better SEO, it is malware.
user8729657
14:01
:) thanks
Sam
Sam
Not sure if im getting a bit confused here.. I've briefly looked at some of the services that services such as AWS offer, for example load balancing. If i were to deploy a production site, should a developer favour using these tried and testing load balancers as opposed to using something such as HAProxy or NGINX? I see a lot of blogs describing how to make apps using NGINX but should I even attempt to implement my own when these services exist?
It's the same with auth, a lot of blogs talk about using open source solutions to implement authentication but when i speak to developers, they say i should always use/pay for a service to do this for me.
14:21
@Sam I guess you won't get a definite answer on that. If you use open source software you 1) have to pay nothing, 2) see the full source code and can work with it, however with paid solutions you got 1) support and 2) a company keeping things up-to-date
Sam
Sam
14:32
Ok makes sense, but even if i do choose to use my own load balancer, im still gunna have to deploy to something like aws right?
@Sam you could also run your own infrastructure. Wether that makes sense is a different thing
user8729657
Man I swear React sometimes confuses me
@OvieAdese No need to swear over it, though.
user8729657
I'm just so confused about passing data between child and parent components.
user10648668
Just in case someone has worked on Google Prettify before: I'm trying to write an add-on for Qiskit, for implementation on Quantum Computing SE. I've forked the code-prettify repository and added the lang-qiskit.js.
user10648668
14:43
It's somewhat working, but it's still not identifying U3Gate as 'typ' (i.e. PR_TYPE), although I updated the regex to ^(?:[@_]?[a-zA-Z]+[a-zA-Z0-9][A-Za-z_$@0-9]*|\w+_t\b). Any idea why?
user10648668
I'm not really conversant in JS though, so perhaps I'm missing out on something obvious.
user8729657
:) im no longer confused
Sam
Sam
@JonasWilms Do startups actually do this?
I mean, I don't mind using services such as AWS. I'm just hesistant as to build the whole thing around it and then become completely locked into it. I want to be as free as possible
If i can somehow use dockers networks to set up my own service structure and port that over to only EC2 instances then that seems highly portable
is it reasonable to use things such as NGINX reverse proxies, docker networks and open source load balancers to build the architecture in development and when ready start looking at services such as AWS for deployment? I guess I dont want to rack up costs during development
Sam
Sam
o/
14:59
@Sam I haven't yet had to work with AWS seriously
But my current company made the choice to go with Azure back when they started, and we're regretting it now.
we use aws, but aren't really taking advantage of many of it's features
Sam
Sam
@KevinB Would you use aws directly when developing a server for example or work completely offline with things such as docker networks?
@MadaraUchiha Why are you regretting?
@Sam To be fair, it's the Microsoft products that got sold to us in the same package that we're regretting now
until january, docker wasn't really an option, i haven't began exploring that idea
SQL Server and the such
Sam
Sam
15:07
@MadaraUchiha Thankfully we have no ties to any ms product
15:50
Why is this not working?
const renderHistory = this.state.history.map(link => {
  return (
    history[history.length - 1] ? <p>{link.shortId}</p> : <p>{link.url}</p>
  );
});
its the last item every time it maps?
Cause history is not defined
And history[history.length - 1] retrieves the last item, which is probably truthy, it does not check wether link is the last one
yeah sorry, it was actually like this
const { history } = this.state;
    const renderHistory = history.map(link => {
      return (
        history[history.length - 1] ? <p>{link.shortId}</p> : <p>{link.url}</p>
      );
    });
but how would I check if link is the last one?
Maybe with a comparison (===) ?
Oh cool, like;
link === history[history.length - 1] ? <p>{link.shortId}</p> : <p>{link.url}</p>
Works like a charm, thank you :)
Yes :) Or just history.map((link, index) => index === history.length - 1 ? ... : ... )
15:59
Very nice :) How would I do to make sure that item renders first?
using .reverse() not really doing it
Reversing my order every letter I type in the forms input field
Ahh nvm, gotta find another way I belive
Sam
Sam
Follow up q from earlier. If I have 2 microservices (each in their own github repo)... when I want to test my application, I need to start containers up for both services manually. Is there a 1-click solution where I can run all services at once? I guess I could make a bash script but that isn't ideal as the bash script may work on my machine but not another
Docker Compose?
Sam
Sam
Where would the compose file exist? in its own repo? Or in all the repos?
16:15
Why do you need different repos at all?
Sam
Sam
Because I'm employing a microservice architecture and it makes sense for different teams to own different services.
"microservice architecture" does not mean that you have to use multiple repos
You got a point with "different teams" though ...
Sam
Sam
Yup, the architecture didn't inform my decision, sorry. It just makes sense as the services will be developed independently of each other. The side affect is it makes it non-obvious (at least to me) how to orchestrate
@rlemon are you here
Sam
Sam
@JonasWilms any ideas?
16:22
@Sam well there are git submodules ... I once worked with them and I always had to keep changes in the different repos in sync ... and it was a nightmare (probably because I'm not that experienced with git)
We then decided to move all code into one repo, which is great as you can easily share code and can keep track of changes across the codebase, but there are just one or two people working on it actively, I can imagine that this won't work for larger teams
Sam
Sam
Even if there are two people working on a project, what happens in the case where service a goes bang.. We will want to roll back to a previous version of service a's state without having to roll back any other changes elsewhere in the application under the same commit.
valentinmihov.com/2015/11/15/… seems useful actually.
I wasn't aware of submodules until you mentioned it.
You could go back to the commit on service A and build that on its own
Sam
Sam
"going back" might have some reverts on other aspects of the code base though no?
brb
You can also revert a single commit ... I guess this is not really different from a submodule architecture
Would be interesting to hear some opinions from a larger codebase/team @anyone?
Sam
Sam
17:23
From what I can tell the sub module architecture links external repos to the root repo
So the commits will still be separate? I guess the concern with your suggestion is if s commit contains many changes across the code base, a revert can cause unwanted changes
 
2 hours later…
Sam
Sam
19:11
@JonasWilms the blog post i linked has some useful insights into this problem. Just been reading through it.
19:44
lmao stackoverflow is tripping ballz today!!!
go 90's
user8729657
I want it forever
20:25
this april fool's joke has gone way too far
I love it
@forresthopkinsa it is not april fools
@forresthopkinsa the mouse effect is what went too far.
@DavidKamer that is the best part blasphemy , also me: the marquee'd stack logo went too far
<marquee>This text will scroll from right to left</marquee>
heh, my first thought was "oh great SO got hacked"
i like the unicorn
majestic
20:38
I wonder what other bs tech companies will do this year
micro-micro services
Is mobx becoming more popular than redux for state management?
or is redux pretty much still the defacto?
I've started using some boilerplate for a project, but thinking should swap out redux for mobx
@BrianJ It is one long unicorn
@BrianJ People here always suggest mobx now, but redux is still really popular
ok good to know

« first day (3088 days earlier)      last day (2084 days later) »