teleren/devto huggingface dataset:
Why I use Markdown to take notes
Tags: firstpost, markdown, devto, blogpost
Published: 2020-07-10 00:28:12

---
published: true
title: 'Why I use Markdown to take notes'
cover_image: 'https://raw.githubusercontent.com/Kvanrooyen/dev.to/master/blog-posts/why-i-use-markdown-to-take-notes/assets/notes.jpg'
description: 'Using Markdown to take notes'
tags: firstpost, markdown, devto, blogpost
series:
canonical_url:
---

This is my first article, so please go gentle on me :grin: but I wanted to talk about why I started using Markdown to take notes.

# Why Markdown

Before I started using Markdown, I used [OneNote](https://www.microsoft.com/en-ie/microsoft-365/onenote/digital-note-taking-app?rtc=1) to take my notes. Why wouldn't I, it was cross-platform, it synced my notes across devices, and it was familiar. I started using it to take notes in my meetings, and it worked ok. I could take the notes, and then I could send them as a message later in our group chat. My issue came in the form of me spending too much time worrying about the formatting and then after the meeting, I would need to format the notes again. When I send the messages on our group chat, I can use a small amount of Markdown.

After using OneNote for about a week of taking notes, I decided that I would try using Markdown. I had some experience with Markdown from GitHub, so I felt comfortable taking notes with it. Markdown seemed like it would help solve my "issues" since I could quickly format the notes (Mainly bolding important things), and focus on taking better notes.

# Choosing and editor

When it came to choosing a Markdown editor, I had 2 main requirements:

- Open Source
- Simple and distraction-free design

I came across some great looking editors, most of which I can't remember now. Eventually, I decided on using [Mark Text](https://github.com/marktext/marktext), it was almost perfect out the box. I only changed a couple of small things before I started using it. I changed the default theme, the font size and have it open a specific folder on launch.

# Final Setup

I have now been using Mark Text and Markdown to take notes, for almost 3 months. So far the experience has been incredibly smooth. I have a folder saved in the cloud, which contains all my notes, this folder is also stored locally on my device. This way if I get a new device or need to use another device, all I need to do is install Mark Text and point to the folder with my notes.

I have saved myself a decent amount of time, by switching to Markdown. I know longer need to spend as much time post-meeting, making sure the notes look good and are easy to read/understand. My typing speed seems to have improved as well, so that's always good. :smiley:

# Found a typo?

If you've found a typo, a sentence that could be improved or anything else that should be updated on this blog post, you can access it through a git repository and make a pull request. Instead of posting a comment, please go directly to [github.com/Kvanrooyen/dev.to](https://github.com/Kvanrooyen/dev.to) and open a new pull request with your changes.
Node Workshop - free online workshop by SCS Concordia
Tags: node, mongodb, beginners, workshop
Published: 2020-07-10 00:24:31

---
title: Node Workshop - free online workshop by SCS Concordia
published: true
description: SCS presents a NODE.JS workshop in collaboration with Autodesk!
tags: #node, #mongodb, #beginners, #workshop
cover_image: https://scontent.fybz1-1.fna.fbcdn.net/v/t1.0-9/74632421_3023094597772698_4026103923882845235_o.jpg?_nc_cat=102&_nc_sid=340051&_nc_ohc=ZZp4TP4F44wAX_-WyFF&_nc_ht=scontent.fybz1-1.fna&oh=9b8990342767858331e19283c55b8cb9&oe=5F2C76CF
---

Come learn about web technologies at this Node.js workshop! 

This workshop will cover code and concepts to help you build a solid foundation for your next web project! We'll ALSO be giving out FREE UBER EATS GIFT CARDS to attendees courtesy of our sponsor, Autodesk!

### Workshop happening at July 16 (Thursday) 17:30 EST

> Sign up through Facebook events: https://www.facebook.com/events/1125391177830448

> or sign up directly through this Google Form:
https://forms.gle/wabMEtUXMW8f9Mj76 

This workshop focuses on Web servers so come and learn how to:
- use Node and Express to build a web server and REST API
- understand routing, request and response
- implement CRUD with HTTP methods
- build a server-rendered website using templates
- connect to a Cloud NoSQL database: MongoDB Atlas DB
- user authentication with sessions, cookies and tokens
- using external APIs, such as Github Jobs, Giphy, Spotify and more!


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zi9et48y73gr7kmhiv1h.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kgu9l7khz3clnnyckew3.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/64feozqhmvankpiexpqi.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xx7wbws3t8tzwm0jxoxc.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dy73bxan3zj2bj5mg3za.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/b7jd9ajydisih3f152qa.PNG)

Here's a quick preview of what you'll be working on and some prior reading to cover:

[Workshop preview in Google slides] (https://docs.google.com/presentation/d/1TjA9uz7fkg7JLzlywe07J0wcC2car4sn60GkI9XsdTg/edit?usp=sharing)

*Note: This is an online event that will be conducted live on YouTube. The link will be provided prior to the event.


See you there! 🤓 
👩‍💻 👨‍💻
Integrando Slim Framework 4 com Doctrine ORM
Tags: php, slim, doctrine, microservices
Published: 2020-07-10 00:24:24

Existem alguns cenários em que precisamos fazer coisas simples, sem a necessidade da interação de diversas bibliotecas e resursos oferecidas pelos grandes frameworks, que poderiam mais prejudicar do que ajudar. Nesses casos o uso de micro frameworks se torna uma boa opção.

Nesse artigo, será demonstrada a integração do [Slim Framework](http://www.slimframework.com/) com o [Doctrine ORM](https://www.doctrine-project.org/).  

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cyrjlmgtx5b2ih2vcq67.png)](http://www.slimframework.com/)

### Configuração

Primeiramente, vamos criar o arquivo que será o *Bootstrap* da aplicação. Nele temos a configuração do nosso container de [Dependency Injection](https://php-di.org/) e as rotas.

{% gist https://gist.github.com/mmdutra/4058dd50a706243686c21079c4fc3d61 %}

O **Doctrine** dispõe um [ferramenta CLI](https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/tools.html) para facilitar tarefas comuns no desenvolvimento com o ORM. Para que possamos utilizá-la, será necessário criar um arquivo **cli-config.php**, no qual registraremos nosso *EntityManager*. 

~~~php
<?php

use Doctrine\ORM\Tools\Console\ConsoleRunner;

require_once __DIR__ . "/../bootstrap.php";

return ConsoleRunner::createHelperSet($entityManager);
~~~

Para gerar nossos Schemas a partir das nossas entidades, podemos utilizar o seguinte comando: 

~~~shellscript
vendor/bin/doctrine orm:schema-tool:update --force
~~~

---

### Persistência

#### Definindo uma entidade com o **Doctrine**  
Para que o ORM reconheça nossa entidade e crie os *Schemas* no banco de dados, usaremos [**Annotations**](https://www.doctrine-project.org/projects/doctrine-annotations/en/1.10/index.html) para definirmos suas colunas e relacionamentos. Por exemplo:

{% gist https://gist.github.com/mmdutra/918224d5ddff66154d9c69bad07f7760 %}

No *bootstrap.php*, colocamos uma instância do EntityManager dentro do container, para que dentro das nossas rotas nós possamos acessá-lo e persistir os dados mais facilmente. Veja um exemplo de uma rota que vai listar todos os registros da tabela relacionada à entidade **Book**:

~~~php
<?php 
// routes.php

$app->get('/book', function ($request, $response) use ($app) {

    // acessando o entity manager através do container ($this)
    $booksRepository = $this->get('em')->getRepository(Book::class);
    
    // pegando todos os registros da tabela 'book'
    $books = $booksRepository->findAll();

    $response->getBody()->write(json_encode($books));
    return $response->withStatus(200)->withHeader('Content-Type', 'application/json');
});
~~~

---

### Conclusão
Portanto, com essas poucas configurações, temos uma ambiente pronto de forma simples e rápida.  

O **código completo do projeto** pode ser encontrado [aqui](https://github.com/mmdutra/slim4-doctrine)    

Espero que tenha ajudado alguém!! Estou sempre aberto a sugestões, correções e dúvidas.   

Até a próxima :D
A New Secret of GitHub
Tags: github
Published: 2020-07-10 00:07:10

Before starting this post, huge thanks to Dipan Roy([github](https://github.com/dipan29) and [Twitter](https://twitter.com/DipanR29)) for making me aware of this new feature. The design I have gone for in my own homepage is inspired by his design as well.

If you visit someone's GitHub profile you could only see their profile picture, a description they provided, their popular/pinned repositories, and some links and details like - location, company, twitter link. Here is how my profile used to look like(maybe yours look like this as well):

![My old GitHub profile](https://dev-to-uploads.s3.amazonaws.com/i/erdr22e1pkz20p8gansv.png)

But, now with this new secret feature, you can add a custom intro to your page. Mine looks like this:

![My new Github Profile](https://dev-to-uploads.s3.amazonaws.com/i/gxxpgmw932oypgy00k8o.png)

So how to get that special README on your GitHub profile? 

## What to do to make that special README?

Remember that special repository you needed to make to get your portfolio page at _your_github_username.github.io_. Yes, the repository with your username. Now, this repository if now is public and has a _README.MD_ can use that README file to create that special introduction README.

But as I did not have that repository, so I went to create a new one and was greeted with this message:

![The Special Repository Message](https://dev-to-uploads.s3.amazonaws.com/i/ef39pl89uxbkr7s278j9.png)

And now, make your README as you wish and create a nice intro.

To take reference from my README file check out [my repository](https://github.com/AyushmanBilasThakur/AyushmanBilasThakur)

> Special Note: I have used [shields.io](https://shields.io/) for the badges on the top of my introductory README.
TIL Android Studio can show KDocs on hover
Tags: android, androidstudio
Published: 2020-07-13 04:13:22

---
title: TIL Android Studio can show KDocs on hover
published: true
date: 2020-07-10 00:00:00 UTC
tags: [Android, AndroidStudio]
canonical_url: https://tigeroakes.com/posts/til-jetbrains-intellisense/
---

I like easy access to documentation written in comments. In Android Studio, and other JetBrains editors, you can display function types and docs on hover when you turn on a simple setting.

In Android Studio’s settings window, go to “Editor” > “General” and check “Show quick documentation on mouse move”. You can leave the delay at the default value.

 ![Android Studio settings with Show quick documentation on mouse move highlighted](https://tigeroakes.com/posts/til-jetbrains-intellisense/settings.png)

When editing code, you can quickly check documentation by just hovering over code.

 ![Android Studio displaying function type and documentation on hover](https://tigeroakes.com/posts/til-jetbrains-intellisense/preview.png)
10th July 2020: IAC Team Status Update
Tags: puppet, modules, community, powershell
Published: 2020-09-04 18:49:39

---
title: 10th July 2020: IAC Team Status Update
published: true
date: 2020-07-10 00:00:00 UTC
tags: puppet,modules,community,powershell
canonical_url: https://puppetlabs.github.io/iac/team/status/2020/07/10/status-update.html
---

This has been as short week for the IAC team and we mostly focused our attention on maintenance and support activities.We want to share with our community some of the most interesting things.Here’s a brief overview of what we’ve been up to:

## Module Releases from IAC Team

- [puppetlabs/iis](https://github.com/puppetlabs/puppetlabs-iis)(7.1.0)
- [puppetlabs/tomcat](https://github.com/puppetlabs/puppetlabs-tomcat)(4.1.0)
- [puppetlabs/powershell](https://github.com/puppetlabs/puppetlabs-powershell)(4.0.0)

## Community Shoutouts for IAC

We appreciate our community contributors as they are always ready to help and they have excellent ideas. Here are some highlights of this week:

Thanks to [Ben Ford](https://github.com/binford2k) for his great idea [feature](https://github.com/puppetlabs/community_management/pull/39) on community\_management.

Thanks to [Chris Denneen](https://github.com/cdenneen) for the contributions on pdk-templates([#338](https://github.com/puppetlabs/pdk-templates/pull/338), [#337](https://github.com/puppetlabs/pdk-templates/pull/337), [#332](https://github.com/puppetlabs/pdk-templates/pull/332))

## Customer Tickets this Week

The team works hard at Docker issue ([MODULES-10691](https://tickets.puppetlabs.com/browse/MODULES-10691)).We have a PR opened for this issue [PR](https://github.com/puppetlabs/puppetlabs-docker/pull/632).Many thanks to [Daiana](https://github.com/daianamezdrea) for managing this problem.

## Michael and Sheena are getting back to DSC revamp work after a hard triage

After triage, [Michael](https://github.com/michaeltlombardi) and [Sheena](https://github.com/sheenaajay) will be working on a handcrafted automated end-to-end test that validates autogenerated modules that are ready for production.

## Happy 90 days at Puppet

A great achievement made by [Adrian](https://github.com/adrianiurca).For the great progress he made in this time, as a reward, he got to write this week’s status update.

## Wrap-up

That’s it for this weeks update, a big THANK YOU for all your contributions and support.
Gatsby Develop with iOS Simulator
Tags: gatsby, react, ios, webdev
Published: 2020-07-10 18:51:59

---
title: Gatsby Develop with iOS Simulator
published: true
date: 2020-07-10 00:00:00 UTC
tags: gatsby,react,iOS,webdev
cover_image: https://images.unsplash.com/photo-1513530534585-c7b1394c6d51?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2551&q=80
canonical_url: https://chrisotto.dev/debug-gatsby-simulator/
series: Working with Gatsby
---

Image from [@norwood](https://unsplash.com/@nordwood) at Unsplash.

Chrome DevTools have come a long way in enabling users to mimic mobile devices. However, if you wanted to debug your Gatsby application locally for mobile specific features you can do that through the iOS Simulator. In order to do this you need to have a Mac, there are other ways around it without a Mac but this post will focus on setting up your Gatsby site to be accessed through the simulator.

## Prerequisites

- A Mac computer
- XCode installed
- Developer Tools Enabled in your Mac’s Safari browser
  - Launch Safari
  - Click Safari in the Menu
  - Preferences
  - Advanced
  - Enable `Show Develop menu in menu bar`

### Start Gatsby 👨‍🚀

First thing we’ll need to do is start the Gatsby site in a special way allowing for local network access. This can be done by using the `-H` parameter when starting `gatsby develop`

```
gatsby develop -H 0.0.0.0
```

### Find Your IP Address 💻

Next you need to find your local IP Address within your network and that can be done in the terminal with the following command.

```
ipconfig getifaddr en0
```

### Launch the Simulator 🚀

For this next part, we’ll be starting XCode and starting to iOS Simulator.

- Launch XCode
- Select XCode in the Menu
- Open Developer Tool
- Simulator

With the simulator up and running we’ll need to navigate to our locally served instance of our Gatsby site.

- Open Safari in the simulator
- In the address bar paste in %IP_ADDRESS%:8000

With the site active in the simulator we can now open up the Safari Developer Tools for debugging our site in the simulator.

- Start Safari on your computer
- Go the Develop in the menu
- Expand the Simulator option
- Click on the IP Address listed for your site
- A new Dev Tools window will launch for your simulator session

Now you’ll be able to use your site as a true mobile user would even change geolocation settings, accelerometer settings, and all the other benefits of iOS Simulator for using your Gatsby application.
How to create and validate JSON Web Tokens in Deno
Tags: deno, jwt, jsonwebtoken
Published: 2020-09-08 12:05:00

---
title: How to create and validate JSON Web Tokens in Deno
published: true
date: 2020-07-10 00:00:00 UTC
tags: Deno,JWT,JSONWebToken
canonical_url: https://www.loginradius.com/engineering/blog/jwt-authentication-with-deno/
---

In this blog, we’ll see how to create and validate a JWT(JSON Web Token) in Deno. For this, we’ll be using djwt, the absolute minimum library to make JSON Web Tokens in deno and Oak framework Before You Get Started This tutorial assumes you have: A basic understanding of…

   
[Read On](https://www.loginradius.com/engineering/blog/jwt-authentication-with-deno/)
General Naming Conventions for Python
Tags: python, pep8
Published: 2021-02-01 11:48:20

---
title: General Naming Conventions for Python
published: true
date: 2020-07-10 00:00:00 UTC
tags: python , pep8
canonical_url: https://tech.serhatteker.com/post/2020-07/python-general-naming-conventions/
---

1. **Class names** should follow the `UpperCaseCamelCase` convention,
2. **Functions, variables and attributes** should be all lowercase and sparated by an underscore (a.ka. `snake_case`),
3. **Non-public/protected attributes** should begin with a single underscore,
4. Use double underscore for **private attributes**.


```python
class MyPythonClass:

  def regular_attribute(self):
    print("Hello Python!")

  def _protected_attribute(self):
    print("Hello Python!")

  def __private_attribute(self):
    print("Hello Python!")
```

For more info: [PEP 8 -- Style Guide for Python Code]


All done!




[PEP 8 -- Style Guide for Python Code]: https://www.python.org/dev/peps/pep-0008/
How to send analytics data to the server before the user leaves using JavaScript
Tags: javascript
Published: 2020-07-10 00:00:00

---
  title: How to send analytics data to the server before the user leaves using JavaScript
  published: true
  tags: JavaScript
  date: Fri Jul 10 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/send-analytics-server-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-27aaf04de7ac23d685f7bc96f60dcd58.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/send-analytics-server-javascript)
  
![analytics dashboard in a laptop](https://melvingeorge.me/_next/static/images/main-27aaf04de7ac23d685f7bc96f60dcd58.jpg)

<p class="text-center">
  Photo by
  <a href="https://unsplash.com/photos/JKUTrJ4vK00" target="blank">
    Luke Chesser
  </a>
</p>

Often we may need to send some analytics to the server before a user leaves a webpage. So the first thing that comes to your mind would be to use `fetch` or `XHR` (XML Http Request) API before document unloads i.e before the user leaves.

```javascript
// when document unloads
// or when user leaves
window.addEventListener("unload", () => {
    // send data to /analytics api endpoint in server
    fetch('/analytics',{
        method: 'post',
        body: analyticsData
    })
        .then(()=> console.log("✅ Success: User analytics send"));
        .catch(()=>console.log("🚨 Error: User analytics not send"));
})
```

But this fetch request is ignored by the browser most of the time even though this is an asynchronous request to improve load times of the next page.

This is where the `navigator.sendBeacon()` method comes into the play.

```javascript
// when document unloads
// or when user leaves
window.addEventListener("unload", () => {
  //send data to /analytics api endpoint in server
  // using navigator.sendBeacon() method
  navigator.sendBeacon("/analytics", analyticsData);
});
```

The `navigator.sendBeacon()` method:

- returns boolean `true` if the browser queues data for transfer and `false` if not.
- requires the API endpoint to send data as the first argument.
- requires the analytics data to be sent to the server as the second argument.
- It is an asynchronous request and doesn't need a response and is guaranteed to run.
- doesn't block the loading of the next page.
- much simpler than `fetch` and `XHR` API.

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

---
Setting up Axios Interceptors (React.js + TypeScript)
Tags: react, typescript
Published: 2020-07-09 23:33:10

### Little tips for best programming practices.

## Debugging is powerful to solve problems

When you are debugging your code on a web application, you have a lot of *Developer Tools* on the browser that help you to find the error and finally understand what is happening. (Although sometimes you prefer to ignore all that power and only use a *console.log (“It works!”)* … Yeah, I know you).

As a developer, I understand that the *Developer Tools* sometimes can be a little a little overwhelming for simple problems that don’t really need breakpoints on every line I wrote.

{% gist https://gist.github.com/charlintosh/f51dbbd7fb286b44795526264195a857 %}

When I work with HTTP requests developing my apps, I always end do a *console.log()* to see what I’m receiving because put it a breakpoint sometimes it’s more tedious, which is great and its helpful under this circumstances. The problem came when I was debugging my code, I needed to write this line every time that I wanted to see the information, which it’s not great. I was wasting my time on this way.

## So, what’s a better way?

I use Axios for do my HTTP requests. Axios have a way to add interceptors to an Axios Instance, which basically are a callback functions that will be executed before a request or after response occurs. A basic interceptor example [1] is:

{% gist https://gist.github.com/charlintosh/55aa7ade13a3eb48e25a227a88e2b010 %}


The idea is add the *log()* (or the you want as *debug()*, *info()*, *warn()*) right here. This will be helpful to avoid putting these lines on every particular request or response we do.

## Do the trick

In this example, I’m using React + TypeScript (and obviously, [ES6](http://es6-features.org/#Constants)), but It must be similar doing without this configuration and simple JavaScript.

*Interceptors.ts*
On this file I created the functions that I want in case a request, request error, response and response error. I exported a function to apply these callbacks to a given Axios instance for do it reusable.


{% gist https://gist.github.com/charlintosh/062c31b8b68377753566eb30e59ad97d %}

## Using the created function to apply the interceptors

Once the interceptors configuration are ready, we can use the *setupInterceptorsTo()* function. In this case, I’m setting up the interceptors to the global axios instance. So, every time I get the axios export default, the interceptors should work!

{% gist https://gist.github.com/charlintosh/72cba5fed5957332daeef03a6adc3f7b %}

If you don’t want to set up the interceptors to the global instance, actually you can create an axios instance for a specific use on your app.

{% gist https://gist.github.com/charlintosh/7ca29b50f8284e3e7401bd4c894bd120 %}

Also, you can add extra configuration to enable and disabled the logs. Like a flag or something like that if you don’t want to see the information on the console.

**Resources.**
 1. (Axios Interceptors Example):
    https://github.com/axios/axios#interceptors