DEV Community

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

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

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

Top comments (25)

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

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
 
maureento8888 profile image
Maureen T'O

I've learned about the Nuxt.js framework, how to integrate Bulma with Nuxt, how to route static pages, and using HTML/CSS for fluidly!

Collapse
 
eagleera profile image
Dany the spacecowboy

did you use Buefy? it's really good!

Collapse
 
maureento8888 profile image
Maureen T'O

I use just regular Bulma! I love Bulma so much 😍

Collapse
 
yosbelms profile image
Yosbel Marín

I've learned about Chakra UI. Also learned this week that UI Fabric decreases my productivity, so I will be better away from it. Last but not least, learned how to integrate Remote Func with Next.js

Collapse
 
nickytonline profile image
Nick Taylor

I haven’t tried it yet, but I’ve heard great things about Chakra UI.

GitHub logo chakra-ui / chakra-ui

⚡️Simple, Modular & Accessible UI Components for your React Applications


chakra-ui symbol

Build Accessible React Apps with Speed ⚡️

All Contributors Bundle Size MIT License NPM Downloads Spectrum Spectrum Spectrum

Chakra UI provides a set of accessible, reusable and composable React components that make it super easy to create websites and apps.

Looking for the documentation?

Here over here => chakra-ui.com

Features

  • Ease of Styling: Chakra UI contains a set of layout components like Box and Stack that make it easy to style your components by passing props Learn more
  • Flexible & composable: Chakra UI components are built on top of a React UI Primitive for endless composability.
  • Accessible. Chakra UI components follows the WAI-ARIA guidelines specifications and have the right aria-* attributes.
  • Dark Mode 😍: Most components in Chakra UI are dark mode compatible.

Support Chakra UI 💖

By donating $5 or more you can support the ongoing development of this project. We'll appreciate some support. Thank you to all our supporters! 🙏 [Contribute]

Individuals

Organizations

Support this project…

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
 
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
 
adam_cyclones profile image
Adam Crockett 🌀

That I am more versatile than I think I am.

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
 
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
 
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