DEV Community

Cover image for Feb. 21, 2020: What did you learn this week?
Nick Taylor
Nick Taylor

Posted on

Feb. 21, 2020: What did you learn this week?

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

Show host saying "Never stop learning!"

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

#todayilearned

Summarize a concept that is new to you.

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

Little kid on Jeopardy answering a question correctly

Latest comments (25)

Collapse
 
resmall profile image
Tiago R. Lammers
  • Learned how to make a Chrome extension (did one actually)
  • Learned that Chrome extensions will be deprecated in the near future
Collapse
 
colewalker profile image
Cole Walker

Vue and CommonLISP. Both are cool!

Collapse
 
nickytonline profile image
Nick Taylor

Noice!

Noice!

Collapse
 
weeb profile image
Patrik Kiss

Learned the basics of VueJS! I'm already making my first app

Collapse
 
bugsysailor profile image
Bugsy Sailor

I learned a PHP class to generate PDF barcodes from the Square API to generate barcode labels for my retail shop.

Collapse
 
fennecdjay profile image
Jérémie Astor

I made my first typescript github actions, and in another one, I use awk, which for some reasons I neglected before.

Collapse
 
iremlaya profile image
Irem Kaya

I learnt to incorporate different React Native libs with each other + with React Hooks!
Also learnt a bit of GraphQL for making a schema for a custom api :)

Collapse
 
zaynaib profile image
Zaynaib (Ola) Giwa

Finally learned how to lift up state in React. T_T I'm still a little bit confused about the subject but at least I got my app to work.

Collapse
 
iremlaya profile image
Irem Kaya

What are you confused about? Is there anything I can help you with? Been coding with React Native + React for a year now :)

Collapse
 
vegafromlyra profile image
Asha Balasubramaniam • Edited

Got some time to clean up my bash prompt by adding a random emoji to it. This was way more fun that I thought it would be.. (also there’s a bug here that’s fixed in a follow up commit 😅)

Collapse
 
chanting_baniya profile image
Aman

Developed an application on Springboot. Exposed rest end points. Created automated tests using Postman. It was a fun excercise.

Collapse
 
donald24ever profile image
Eyituoyo Donald Okegbe

Finally understood a lot on react and got my hands dirty with it. Hoping to learn more and go down further

Collapse
 
nickytonline profile image
Nick Taylor

Noice!

Noice!

Collapse
 
ffirsching profile image
Felix Firsching

This week I learned more about the Net Core Request Pipeline.
Especially, that when using a controller with non default ActionResult return type, like for example BadRequest(), that these ActionResults will get wrapped in another ActionResult, which makes unit testing kind of tedious. E.g.:


        // controller method
        [Route("{id:int}")]
        [HttpGet]
        [ProducesResponseType(StatusCodes.Status200OK)]
        [ProducesResponseType(StatusCodes.Status404NotFound)]
        public async Task<ActionResult<Author>> GetOneById(int id)
        {
            Author result = await _authorService.GetById(id);

            if (result != null)
            {
                return result;
            }
            else
            {
                return NotFound();
            }
        }

        // tests
        [Fact(DisplayName = "Should return correct author by id")]
        public async Task Should_Return_Author_By_Id()
        {
            // arrange
            var expected = fixture.authorList.Where(author => author.Id == 1).FirstOrDefault();

            // act
            var result = await controller.GetOneById(1);

            // assert
            Assert.IsType<ActionResult<Author>>(result);
            Assert.Equal(expected, result.Value); // Using Value since ReturnType is ActionResult<Author>, so we need to access the value
        }

        [Fact(DisplayName = "Should return NotFound()")]
        public async Task Should_Return_Author_NotFound()
        {
            // act
            var result = await controller.GetOneById(999);

            // assert
            Assert.Null(result.Value);
            Assert.IsType<ActionResult<Author>>(result); // check method return type matches
            Assert.IsType<NotFoundResult>(result.Result); // check actual return is as expected
        }
Collapse
 
nickytonline profile image
Nick Taylor

Mario approves. He's just not sure which pipeline to jump into 😉

Someone playing Super Mario 1

Collapse
 
odilonjk profile image
Odilon Jonathan Kröger

I've learned about writing example tests on Golang, to show the code on godoc.
I also learned how to deploy an application on GCP App Engine. :D

Collapse
 
astrit profile image
Astrit

Today I learned about twitter.com/visualizevalue hands down the best twitter account to follow 🤘🚀

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

That I am more versatile than I think I am.

Collapse
 
dzhavat profile image
Dzhavat Ushev

I learnt how to make a script to kill a port (to stop a localhost server) by calling an npm command that runs a js file that runs a PowerShell script. Works like magic.

It was my first time touching a PowerShell script so this gave me extra points :D