teleren/devto huggingface dataset:
How to get the last modified time of the file synchronously using Node.js?
Tags: node
Published: 2021-04-19 00:00:00

---
  title: How to get the last modified time of the file synchronously using Node.js?
  published: true
  tags: Nodejs
  date: Mon Apr 19 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/get-last-modified-time-of-file-synchronously-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-f3d51d8b844888aa5c18ef47ee7309c6.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/get-last-modified-time-of-file-synchronously-nodejs)
  
To get the last modified time of a file synchronously, you can use the `statSync()` method from the `fs` (filesystem) module and then use the `mtime` property from the returned `stats` object in Node.js.

Let's say we have a file called `myFile.txt` in which you want to get the last modified time. Here you can use the `fs.statSync()` method and pass:

- the `path` to the file as an argument.
- the method returns a `stats` object where we can use the property called `mtime` to get the last modified time.

**The `mtime` property returns a valid `Date` object in JavaScript**

It can be done like this,

```js
// require fs module
const fs = require("fs");

// get last modified time using fs.statSync() method
const stats = fs.statSync("./myFile.txt");

// get modified time of the file
const modifiedTime = stats.mtime;

console.log("File last modified at: ", modifiedTime); // File last modified at:  2021-04-30T23:53:07.633Z
```

See the above code live in [repl.it](https://replit.com/@melvin2016/get-last-modified-time-of-file-synchronously-nodejs).

If you want to see the `Date` in a more human-readable way you can use the `Date` object methods. Let's use the `toUTCString()` method like this,

```js
// require fs module
const fs = require("fs");

// get last modified time using fs.statSync() method
const stats = fs.statSync("./myFile.txt");

// get modified time of the file
const modifiedTime = stats.mtime;

console.log("File last modified at: ", modifiedTime.toUTCString()); // File last modified at: Fri, 30 Apr 2021 23:53:07 GMT
```

That's it! 😀

### Feel free to share if you found this useful 😃.

---
W3C Games CG April 2021: Unity and WebCodecs
Tags: w3c, gamedev, unity3d, webcodecs
Published: 2021-04-21 09:55:18

---
title: W3C Games CG April 2021: Unity and WebCodecs
published: true
date: 2021-04-19 00:00:00 UTC
tags: w3c, gamedev, unity, webcodecs
canonical_url: https://end3r.com/blog/w3c-games-cg-apr-2021/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lw2wlqt3em08yzv2j6vf.jpg
---

Another bi-monthly online meetup of the [W3C Games Community Group](https://end3r.com/blog/tag/w-3-c-games/) happened a few days ago, on April 15th, and this time two main presentation topics revolved around **Unity** and **WebCodecs**.

**Anthony Bowker** from **Unity** was talking about their efforts towards HTML5 export, and **Unity Tiny**.

![End3r's Corner - W3C Games CG April 2021: Unity Tiny](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojtjgr082wvpyyh7njse.jpg)

That is some important work, since **Unity** have a huge user base, which can create top quality content for the Web - it have to work smooth, including mobile devices.

![End3r's Corner - W3C Games CG April 2021: WebCodecs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/297kpidpbibuy1bicbu4.jpg)

The second talk was about **WebCodecs** , and had three speakers: **Bernard Aboba** from **Microsoft** , **Chris Cunningham** from **Google** , and **Paul Adenot** from **Mozilla**. Chris was leading most of the talk, discussing the technical aspects of **WebCodecs** , which can greatly increase the performance of audio decoding in Web game engines and games themselves.

![End3r's Corner - W3C Games CG April 2021: Gamedev.js Survey 2021](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jc2mv1cnv9sa5zjaqwsg.png)

After the talks there was time for open discussion, where I quickly presented the [Gamedev.js Survey 2021](https://gamedevjs.com/survey/2021/) results, and talked about the [Gamedev.js Jam 2021](https://gamedevjs.com/jam/2021/) that is currently happening. I raised the [decentralization and games](https://gamedevjs.com/competitions/decentralized-category-in-gamedevjs-jam-2021/) topic at the end of my talk, and we might actually have some presentations related to that at the next meetup already.

**Tom Greenaway** also proposed to have a second bi-monthly gathering where we could have hands-on workshops on attempting to solve specific high-level issues, like lack of virality in Web games, their monetization, copyright issues, etc. There was a positive response to this idea, so we might have the first one next month already.
FEATool Multiphysics 1.14 - Parallel FEA, CFD, and Multiphysics Simulations
Tags: multiphysics, openfoam, cfd, simulation
Published: 2021-04-28 08:13:34

---
title: FEATool Multiphysics 1.14 - Parallel FEA, CFD, and Multiphysics Simulations
published: true
date: 2021-04-19 00:00:00 UTC
tags: multiphysics, openfoam, cfd, simulation
canonical_url: https://www.featool.com/news/2021/04/19/FEATool-Multiphysics-v1p14-Parallel-FEA-CFD-and-Multiphysics-Simulations.html
---

The updated FEATool Multiphysics and CFDTool toolboxes are now available featuring built-in parallel processing support for the FEniCS FEA, and OpenFOAM and SU2 CFD solvers.

Complexities of setting up parallel is now essentially completely automated with FEATool and CFDTool. The toolboxes automatically subdivides the meshes, defines and sets up parallel case files, solves, and recombines the solutions completely seamlessly so that users can get the benefits of parallelization without every having to think about it.

With the unique multi-solver simulation capabilities it is now also possible to select and solve for different equations and physics models with different solvers. This enables one to use the most accurate and efficient solvers for different parts of a model, whether using OpenFOAM or SU2 for simulating the fluid flow, and FEniCS or the built-in solver for coupling and modeling other physics modes. Combined with the introduced parallel processing support, the multi-simulation process saves both computational time and memory, and enables solving larger scale models not before possible with limited resources.

Visit https://www.featool.com/news/2021/04/19/featool-multiphysics-v1p14-parallel-fea-cfd-and-multiphysics-simulations for more information and toolbox download.

![Coupled heat transfer simulation with both the OpenFOAM and FEATool Multiphysics solvers.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gs5gd9o1juxa5hdz2du.jpg)
Is your agile framework working?
Tags: agile, methodology, practices, productivity
Published: 2021-04-21 12:41:52

---
title: Is your agile framework working?
published: true
date: 2021-04-19 00:00:00 UTC
tags: agile,methodology,practices,productivity
canonical_url: https://jhall.io/archive/2021/04/19/is-your-agile-framework-working/
---

There are [_many, many_](https://en.wikipedia.org/wiki/Agile_software_development#Agile_software_development_methods) agile software development frameworks or methodologies. Does this mean that using one will make you agile?

Of course not.

From the [Twelve principles behind the Agile Manifesto](https://agilemanifesto.org/principles.html):

> Working software is the primary measure of progress.

No matter how many Post-its, whiteboards, standups, or other artifacts your team produces, if you’re not producing working software, you’re not making progress.

* * *
If you enjoyed this message, [subscribe](https://jhall.io/daily) to _The Daily Commit_ to get future messages to your inbox.
How to improve as a Developer (personal tips)
Tags: improvement, developer, softskills, english
Published: 2021-04-18 23:32:22



In the beginning of my learning path, there was so many times where I wanted to increase my skills or just learn something new, but had no ideas for what to do. Or even moments where there were so many ideas and I didn’t know how to start any of them. I used to struggle to keep my focus when learning something new, or working in a new project I had planned.
After some thinking and research, I’ve found some tips that helped me to decide what, and more important how to do that.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kh9p2pbuxm00cno2wg23.png)

##**First of all, have you decided what you want to build or learn?**

If you have already decided which technology you want to learn or some project you want to build, or even just some little thing you want to improve in yourself? If yes, congratulations, you’ve done your homework (and you can go directly to the topic “How to organize yourself?”). But if not, you are in the same place as me in the beginning.
Some ideas if you don’t have any yet are: Habits tracker; Work with a public API; Any new technology; Automate or solve any personal trouble (I really like this one); Weather Checker?

`Sorry for that, but it is what it is.`

After you choose what you want to do, break your entire project in small goals. Start with the closer to a “Hello World” you can.

Fix this mindset: Make it work, after that make it beautiful. Don’t worry if your project doesn’t look so fancy, faster, or even well written. As a developer, we must understand the problem we’re facing, and the ability to break it in small steps is a huge helper. 

Take your time to do your things.
As soon you start building your project’s base, the improvement will be so much smoother than if you had ran over the steps just to make it beautiful first.

`I prefer an app that solve my problem, and you?`

Some ideas that I think are great to challenge yourself (even if you have already build any of this, you may consider give it a try and make it better than last time).


##**Organize yourself**

Make a deal with yourself, and set how much time you want to spend it which day or in the entire week, and stick with it.
If you are familiar with GIT, create your directory in Github (or any other place you like) and make sure to update your project frequently. Seeing your improves in the code will boost your will for finish it.

That’s it. I hope I’ve helped you in some way. See you in later posts.
01 Compose - Table of Contents
Tags: compose, kotlin, jetpack, android
Published: 2021-04-18 23:30:17

#TABLE OF CONTENTS:
[1. 02 Overview](https://dev.to/one_past_last_jedi/jetpack-compose-001-overview-1-2h94)
[2. 03 Managing State in Compose](https://dev.to/one_past_last_jedi/jetpack-compose-003-managing-state-in-compose-1mfo)
[3. 04 Layout – Box and Modifier](https://dev.to/one_past_last_jedi/jetpack-compose-004-layout-box-and-modifier-2386)
[4. 05 Layout – Box and Modifier Functions 1 ](https://dev.to/one_past_last_jedi/05-compose-layout-box-and-modifier-functions-1-1hil)
[5. 06 Layout – Modifier Functions 2](https://dev.to/one_past_last_jedi/06-compose-layout-modifier-functions-2-51ep)
[6. 07 Layout – Column + Row + Spacer](https://dev.to/one_past_last_jedi/07-compose-layout-column-row-spacer-291j)




================================================


*You can join us in the discord server*
https://discord.gg/TWnnBmS
*and ask me any questions in (#kotlin-and-compose) channel.*

[**Next Class**](https://dev.to/one_past_last_jedi/jetpack-compose-001-overview-1-2h94)
100 Bytes Of Wisdom: Day 41
Tags: career, journey, advice
Published: 2021-04-18 23:17:12

---
title: 100 Bytes Of Wisdom: Day 41
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
//cover_image: https://direct_url_to_image.jpg
---

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pziwtxfdl12r1pyf94iz.png)


A trap a lot of developers fall into is trying to write really DRY, generic code the first time. This is often a more costly exercise as it takes longer to do so. This comes back a little to an earlier Byte of Wisdom where I spoke about being pragmatic. Being a good engineer is being an engineer that writes the code for the task at hand, not some imaginary future tasks. 
That being said, if you do have opportunities for reuse coming up in your task list or roadmap, then you may take more time now if your time is okay with that. 

It's totally also okay to ask the person running your team/product about future tasks you think your current one might be generic enough to cover it as well. Once again, it's an art and you'll get better at it over time.

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/
How to recover KDE if it doesn't load after updating FreeBSD from 12.x to 13.0-RELEASE
Tags: freebsd, kde, drivers, howto
Published: 2021-04-18 21:22:29

You followed the official instructions to update your FreeBSD 12.x installation to 13.0-RELEASE, but now you've rebooted into a `login:` prompt. What went wrong?

The technical reason for this is there are driver changes involved in the update, and FreeBSD doesn't appear to be able to determine which driver will work for your hardware.

To expand on that point, your existing driver type that worked in 12.x might not work in 13.0-RELEASE, but FreeBSD cannot determine which 13.0-RELEASE driver type will work for you. This means you'll have to manually select the driver and load it into the kernel. Let's do that.

1. Login to the FreeBSD terminal
2. `# pkg update`
3. `# pkg upgrade`
4. `# pkg install drm-kmod`
5. `# kldload drm`
6. Edit `/etc/rc.conf` (I prefer `# nano /etc/rc.conf` for that task) to comment out any existing `kld_list` line
7. Add the following line to `/etc/rc.conf`: `kld_list="cuse fusefs usbhid drm"`
8. If you're in `nano`, press `CTRL` + `O` to save your changes
9. Hit `Enter` at the prompt
10. Press `CTRL` + `X` to exit `nano`
11. Reboot

KDE (technically SDDM) should come up at this point and you should be presented with a DE login.

The above process used a generic DRM driver. For optimal performance and functionality, you'll need to load the driver specific to your hardware. You'll find the driver names [here](https://wiki.freebsd.org/Graphics). If, for example, you're using an Intel iGPU, repeat the previous steps from the terminal within KDE, replacing `drm` with `i915kms` throughout.

Since the fix described here doesn't reference anything KDE, it should also work for other DEs, such as Gnome, XFCE, etc. 

----

Credit: this [thread](https://www.reddit.com/r/freebsd/comments/mqffti/12x_to_130_update_130_should_boot_straight_into/guyq3o5/?utm_source=reddit&utm_medium=web2x&context=3) from [u/grahamperrin](https://www.reddit.com/user/grahamperrin)
What are metadata and meta tags
Tags: html
Published: 2021-04-18 19:53:52

---
title: What are metadata and meta tags
published: true
description: How to use meta tags
tags: HTML
canonical_url: http://makneta.herokuapp.com/post/what-are-metadata-and-meta-tags/
//cover_image: https://direct_url_to_image.jpg
---

## What is metadata?

Metadata is data about data. It means that it's usually a short description or summary that describes the content. 

When we are learning HTML we usually omit that part as not so important because it is something we can't see on our websites. But it can be read by search engines so metadata is important for SEO purposes.

## How do we add metadata to our websites?

The place for metadata is in the head of our HTML document. There, we're supposed to add Meta Tags. 

When we use code editors with Emmet, we usually can produce the skeleton of our HTML file typing only !, so we often don't think about meta tags. We already have things like the character set used in the page (charset tag), the version of Internet Explorer (http-equiv="X-UA-Compatible", content="IE=edge") and set the viewport to the device-with that helps with making our website responsive.

Let's look at the file produced with Emmet:
```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
```
We also have the title tag there. Always remember to add your title. For SEO purpose it is good to start the title from a keyword but it shouldn’t be overloaded with keywords. The length of the title should be less than 60 characters.

## What other meta tags can we use?

**description** - it’s a summary of your page, you can write to your users to encourage them to click, you can use keywords here as well as add an offer or a discount. 
**author** - here you can add the author of the website

```
 <meta name="description" content="This is the description of a site that would be seen in the google search">
 <meta name="author" content="Your name">
```

Meta tags are not only important for SEO purposes but also to prepare nice shareable social media objects. 

## How to prepare nice Social Media cards using Meta Tags?

A few years ago Facebook introduced Open Graph meta tags. Thanks to them we can control how URLs of our website are displayed on Social Media. 

Open Graph tags has got **og:** before tag’s property

Mostly used tags are:
**og:title**
``` 
<meta property=”og:title” content=”Title of the content” />
```
**og:url**
```
<meta property=”og:url” content=”https://yourwebsite.com” />
```
**og:image **
```
<meta property=”og:image” content=”https://yourwebsite.com/photo-link.png” />
```
**og:type **
```
<meta property=”og:type” content=”article or website” />
```
**og:description**
```
<meta property=”og:description” content=”description you want to have on the social media card” />
```

After adding those Open Graph tags you can check how your social media card will look like on this page: 
https://www.opengraph.xyz/
New Week Start!
Tags: laravel, codenewbie, discuss, codereview
Published: 2021-04-18 21:03:07

Hey everyone,
First I am thankful to all of you who shared knowledge on the dev community. That's really helpful for all of us. who want to learn about code. 
So I am motivated to do some extra things this week like I am going to start a project in laravel. I am not much know about laravel but I think building a project is a great source of learning.

if you have any suggestions for me please write in the comment section.
please share what are you start this week.
education CMS (Content Management System) website so that each school can open its own page or site
Published: 2021-04-18 21:01:46

Hi guys, I need help in planning how to build my website. How would I go about building an education CMS (Content Management System) website so that each school can open its own page or site and have all the functionality and then allow their students to log in? (Each school would be separate from each other). Thanks in advance. MVP can be in wordpress and then using React and Node.js.
Help with jasmine Promise then testing
Published: 2021-04-15 18:35:02

Good evening Angular developers, particularly those involved with jasmine unit testing...
I have a hard time when it comes to more complex testing scenarios, I would like a little help from anyone who might help...

I am trying increase the code cover in my unit tests, but whe it comes to the code inside the "then" and "catch" block of my promises, I simply cannot coverage of my application, as shown in the print.

Within my spec file, I tried the following:



    it('should return app values', fakeAsync (async () => {
    const mockValues = {test: 123};

    const mockSubject = new Subject<any>(); // create subject of your object type
    
    const energiaServiceStub: EnergiaService = TestBed.inject(EnergiaService);

    spyOn(energiaServiceStub, 'get').and.returnValue(mockSubject.asObservable());
    await service.getAgenteInformacoesCadastrais(consultaContratoRequestMock);
    mockSubject.next(mockValues);
    mockSubject.complete();
    tick();
    expect(component.historic).toBeDefined();

 


Thanks in advance folks! <3
Bottom navigation bar
Published: 2021-04-18 20:28:17

A barra de navegação inferior é uma importante ferramenta para auxiliar na usabilidade de um aplicativo movél. 

Neste post, veremos seus princípios, boas práticas e implementação em um aplicativo android.

**1. Princípios:**

**Ergonômico**: a barra de navegação inferior é de fácil acesso no dispositivo móvel.

**Consistente**: quando em uso, a barra aparece abaixo de todas as telas do gráfico.

**Relacionados**: Os destinos da barra de navegação devem estar relacionados em nível de importância.

**2. Casos de uso:**

**Tipos de destinos:**
A barra de navegação inferior deve ser usada para facilitar o acesso aos destinos de alto nível, que podem ser acessados em qualquer lugar do app. Além disso, não devem ser destinos de tarefas únicas como configurações ou preferências.

**Quantidade de destinos:**
Recomenda-se a implementação de pelo menos 3 e no máximo 5 destinos. Para menos de 3 destinos, utilize guias superiores. Para mais de 5 destinos utilize guias superiores ou um painel.

**Combinações:**
Evite utilizar a barra de navegação inferior em conjunto com guias superiores para não confundir os usuários.

**3. Implementação no Android**

A implementação da barra de navegação inferior no Android pode ser facilmente realizada pelo Android Studio. Ao iniciar o projeto, deve-se escolher o template "Bottom Navigation Activity".

![Screen Shot 2021-04-18 at 14.40.15](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gf7zq7l6xxz004ecwru.png)

Dessa forma, o projeto é criado com a barra de navegação inferior para 3 destinos. Já estão implementados o gráfico de navegação, a Activity principal e os Fragments relativos aos destinos. 

No layout da Activity principal, é possível ver a implementação da View referente a Bottom Navigation.

![Screen Shot 2021-04-18 at 14.48.02](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bycroryjmbyxb8llzhlv.png)
 
Também é implementado o layout do menu, onde é possível acrescentar, editar ou remover os itens referentes aos destinos.

![Screen Shot 2021-04-18 at 14.47.31](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ohfc3p9dxltidphbtje0.png)

Com as configurações iniciais do template, este é o resultado da barra de navegação inferior no aplicativo: 

![Screen Shot 2021-04-18 at 16.57.53](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n91qf3vo8hw0uvrkpfwq.png)
 


####4. Referências:

Developers. ***Atualizar componentes da IU com NavigationUI.*** Navegação Inferior. Disponível em:
<https://developer.android.com/guide/navigation/navigation-ui#bottom_navigation>. Acesso em: 15 abr. 2021.

Material Design. ***Bottom navigation.*** Disponível em: <https://material.io/components/bottom-navigation>. Acesso em: 15 abr. 2021.

PIRES, Alifyz F. ***Usando Navigation Component — Android Jetpack.*** 2019. Disponível em: <https://medium.com/android-dev-br/usando-navigation-component-android-jetpack-e1356921b31d>. Acesso em: 15 abr. 2021.