teleren/devto huggingface dataset:
PowerShell Core | Out-GridView Welcome Back
Tags: opensource, powershell, ptbr
Published: 2019-11-17 17:27:01

---
title: PowerShell Core | Out-GridView Welcome Back
published: true
date: 2019-08-31 02:37:27 UTC
tags: open-source,powershell,pt-br
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/1*GvMef2yMZWhHMXOFOjyiQg.jpeg)<figcaption>PowerShell Core| Tips | Ewerton Jordão</figcaption>

E ae, pessoal, beleza ? Vamos falar sobre uma feature muito bacana para quem utiliza o **PowerShell 5.1**. Esse cmdlet está disponível por padrão, porém, se você utiliza o PowerShell Core 6.X provavelmente notou que ele não estava disponível, mas isso acabou 🥳🥳🥳.

O grid é bem útil na visualização do output de objetos, pois conseguimos aplicar filtros,e é uma ótima opção para usuários com pouca intimidade com scripts.

### Vamos então aos passos necessários para utilizar o Out-GridView.

1. Ter o PowerShell Core 6.2+ no seu SO. (disponível para Linux, Windows, macOS, everywhere)
2. E o módulo Microsoft.PowerShell.GraphicalTools.

{% gist https://gist.github.com/EwertonJordao/8ba7faaef23036e1d22c93dbcd68dc30.js %}

> _Obs: No script presumo que você já tenha o_ **_PowerShell Core_** _no seu SO, e que a PSGallery esteja como_ **_provider trusted_** _, ao instalar um módulo ele vai buscar em um repositório que neste caso é a PSGallery._

Output esperado após executar o cmdlet acima.

![](https://cdn-images-1.medium.com/max/713/1*Q-mQBatMUczIE9Abs21iKQ.png)<figcaption>InstallationPolicy igual a Trusted</figcaption>

Caso o Output do cmdlet seja conforme tabela abaixo:

![](https://cdn-images-1.medium.com/max/705/1*qW6OYc5_VOiO9-U1EdyhUQ.png)<figcaption>InstallationPolicy igual a Untrusted</figcaption>

Definimos o valor para **Trusted** desta maneira:

```
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
```

Exemplo do Out-GridView no Windows 10:

![](https://cdn-images-1.medium.com/max/880/0*xRgKRFRu2ulySxzK.jpg)

Exemplo do Out-GridView no centOS:

![](https://cdn-images-1.medium.com/max/880/0*jieu6BAzIxlI9kWc.png)

Fico devendo o output no macOS :/, desculpe.

É isso pessoal, não se esqueça, **PS é vida**.

Curtiu? Quer saber mais?

[PowerShell/GraphicalTools](https://github.com/PowerShell/GraphicalTools)
Share your best Serverless resources (please? :) )
Tags: serverless, architecture, devops
Published: 2019-08-31 02:05:31

---
title: Share your best Serverless resources (please? :) )
published: true
description: 
tags: serverless, architecture, devops
---

Hi dev.to!

I have an upcoming challenge involving everything Serverless and I'm looking to compile a list of resources for future reference. I'm looking for material beyond basic tutorials and more focused on architecture and multi-cloud.

I mean: who to follow? Maybe books? Courses, blog posts, etc.

For example today I found James Beswick's [posts](https://medium.com/@jbesw) which I find super interesting and helpful since he covers other topics beyond "how to build this and that".

Thanks!
Exporting a markdown book to PDF with Pandoc
Tags: pandoc, markdown, books
Published: 2019-08-31 01:49:32

---
title: Exporting a markdown book to PDF with Pandoc
published: true
description: 
tags: pandoc, markdown, books
---

I have been wanting to write a book for some time now. I've accumulated lots of experience both in my career in automation and controls, and on my own I have learned tons in software engineering, game dev, etc, the list is huge.

All this stuff rattling in my head needs to come out at some point, at my job and for my personal projects I tend to document very well and that has pushed me to get better at writing.

I have decided to write maybe a few books in markdown, well we'll see how the first one goes.

## Setup

The markdown editor that you use makes no difference, I use [Typora](https://www.typora.io/). If you are not sure vscode has pretty good support for markdown files, and most text editors do. @awwsmm did a great write up on markdown editors [state-of-markdown-editors-2019](https://dev.to/awwsmm/state-of-markdown-editors-2019-2k49)

In addition to that, I use [Pandoc](https://pandoc.org/), you'll need LaTeX to print PDFs, make sure to follow the [instructions](https://pandoc.org/installing.html).

## Exporting to PDF

I structured my chapters in directories, like shown below:

```
├───title.txt
├───Chapter1
├───Chapter2
└───images
```

The title is like a header for pandoc:

```
---
title: Book Example
author: Fernando B.
rights: Nah
language: en-US
---
```
### Pandoc Resources
- [Getting Started](https://pandoc.org/getting-started.html)
- [Demos](https://pandoc.org/demos.html)

The below command will add table of contents, output to book.pdf, get title info from title.txt and grab three markdown files.
```
pandoc --toc -o book.pdf title.txt .\Chapter1\Scene1.md .\Chapter1\Scene2.md .\Chapter2\Scene1.md
```

## Going beyond the command line

As you can imagine as your book grows, things will get harder to compile. I couldn't find a library or an easy parameter that takes a list of md files in a directory so I wrote a python script [export_book.py](https://github.com/kodaman2/markdown-book/blob/master/export_book.py). For now the script needs to be in the book root directory, but in the future I will probably expand on it.

[Full Repo](https://github.com/kodaman2/markdown-book)

## Other items to think about
I need to experiment with css for formatting the book a bit better and adding header and footer, and so on, but this is a good start for anyone trying to accomplish the same or even writing academic papers as pandoc can output to different formats.
Practice what you don't like
Tags: beginners, career, css, todayilearned
Published: 2019-08-31 01:43:55

Have you ever really not wanted to do a thing? Like really not wanted to to the point where it gave you the heebie-jeebies?

For programming it was CSS.

I am a scientist so having to use something that feels so imprecise feels innately wrong. One small change shouldn't make your website into a Picasso painting right?

Well I have been working on my website SeeSignStories and I know that this has to be an easy to navigate site that is responsive to a wide range of operating systems and screen sizes. The children using it will be in early elementary school and grabbing their parents phones or tablets, definitely not using a desktop computer. So I have been working an awful lot with CSS and learning about different viewports and doing tons of media queries.

I can solidly say that CSS and I have become better friends. Since I am looking for my first job front-end positions seem less daunting since I know I can do it.

In summary, if you don't like something or it is hard, you probably just need to practice it more.


On a side note if anyone has any tips about naming classes for CSS or organizing the giant CSS file with media queries let me know! Or eTags since my next mission is to not use up my Youtube API quota so quickly...
My Dealings with Event Handlers
Tags: react, ui, ux, javascript
Published: 2019-08-31 01:36:05

---
title: My Dealings with Event Handlers
published: true
description: " Event handlers help keep track of every action performed by the user...."
tags: react, ui, ux, javascript
---

### As you may or may not know,  I am currently on my journey of becoming better at JavaScript and React. 

This has been easy at times but harder as the topics get more complicated and I continue to grow as a developer. One of
the topics that have been difficult but interesting is how Event Handlers are dealt with in React. 


#### To give a little bit of background info on this particular topic: 

*Event handlers help keep track of every action performed by the user. *
*This can be anything from resizing a window, clicking on links, a page scrolling, all of which are processed by event handlers. *

#### Things to keep in mind: 

1. The naming of events in React are of great importance, and adding events is similiar to how they are added to DOM elements.

2. Synthetic events play a role, as they are needed to provide event details and can be passed into event handlers as well as callback functions.

3. Defining events using JSX: use the camelCase event with the handler or callback function as the property of the JSX that is a placeholder for the element in React.

My first exposure to event handlers came in the form of tutorials in the Learn ReactJS course on Codecademy. 
While it was only a small preview, that part of the lesson gave me insight into updating parent and child components in React through the use of event handlers. 
Continuing onward, I want to make sure that the concepts that I am being exposed to will help me in the implementation aspect when building new projects. I have a long way to go with becoming stronger in React, and while this topic was a challenge, 
determining the logic behind it helped to broaden my understanding and increase my knowledge base.

This post also appears on my [blog](https://objector.dev/posts/2019/my-dealings-with-event-handlers/) as well, feel free to check it out.
SAY NO TO SUICIDE PUBLIC LICENSE
Tags: github, watercooler
Published: 2019-08-31 01:32:16

GitHub: https://github.com/unbug/snts

--------------------------------------------------------------------------------------------


# SAY NO TO SUICIDE PUBLIC LICENSE 

We've lost so many genius developers, who committed suicide, 
such as [Aaron Hillel Swartz (November 8, 1986 – January 11, 2013)](https://en.wikipedia.org/wiki/Aaron_Swartz).

As a developer, the community needs you, the world needs you, please keep yourself alive.

```
SAY NO TO SUICIDE PUBLIC LICENSE 

Version 1.0, September 2019

Copyright (C) [year] [fullname]

Everyone is permitted to copy and distribute verbatim copies
of this license document.

TERMS AND CONDITIONS FOR USE, REPRODUCTION, MODIFICATION, AND DISTRIBUTION

  1. You can do anything with the original copy, 
  whenever, whatever, no limitation.
  
  2. When you are in despair, just talk to someone you trust, 
  someone you love. Getting help from your family, your friends, 
  the police, the community, the public.
  
  3. Keep yourself alive and say no to suicide.
```
An in-depth guide on the entire interview process.
Tags: webdev, career, javascript
Published: 2019-08-31 01:13:05

---
title: An in-depth guide on the entire interview process.
published: true
description: An in-depth guide on the entire interview process, from HR screening all the way to getting hired.
tags: webdev, career, javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/bonvcbecfzafrcqc3lai.png
---

**About Me:** I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at [Better Coding Academy](https://codebetter.com.au), and as part of what I do, I post videos on our YouTube channel at [https://www.youtube.com/c/BetterCodingAcademy](https://www.youtube.com/c/BetterCodingAcademy).

_(Subscribe for awesome web development content!)_

I recently got the opportunity to sit down with Patrick. He has extensive interview experience and an amazing interview record, and I pick his brains on how to pass each stage of the interview process in the video below.

{% youtube 9bDUaIM3_Ps %}

Happy coding!
Shutdown After Job
Tags: linux
Published: 2023-01-06 01:58:11

---
title: Shutdown After Job
published: true
date: 2019-08-31 00:43:56 UTC
tags: Linux
canonical_url: https://brandonrozek.com/blog/shutdownafterjob/
---

I’m back to running longer jobs as part of my research. If I run a task overnight, I want to conserve energy and not keep it running after I finish. I suppose this would also apply to cloud billing, you want it to do the job and then stop.

This technique will require you to have sudo privileges on the machine.

1. Change user to root.

```
sudo su

```

1. Run job as regular user, write output to file, and then poweroff.

```
su -u user task > output.txt && chown user:user output.txt && poweroff 

```
Local Repo From Live Installer
Published: 2023-01-06 01:58:40

---
title: Local Repo From Live Installer
published: true
date: 2019-08-31 00:26:53 UTC
tags: 
canonical_url: https://brandonrozek.com/blog/localrepoiso/
---

I’m going to share my experience setting up a local repo from a CentOS live CD. These instructions should work similarly in REHL.

When working with off-network systems, it is often useful to have the base packages on the system after the installation process. Luckily the base packages are commonly included in the ISO installer.

First I’m going to assume that you’ve mounted the ISO at `/mnt`.

```
sudo mkdir -p /repos/local
sudo rsync -Paz /mnt/Packages /repos/local/Packages
sudo rsync -Paz /mnt/repodata /repos/local/repodata 

```

Then create the file `/etc/yum.repos.d/local.repo`

```
[local]
name=Local Repo
baseurl=file:///repos/local/
gpgcheck=0
enabled=1

```

Now you’re all set to go with the packages on the Live CD!
Network Throughput Testing
Tags: linux, networking
Published: 2023-01-06 01:58:59

---
title: Network Throughput Testing
published: true
date: 2019-08-31 00:11:26 UTC
tags: Linux,Networking
canonical_url: https://brandonrozek.com/blog/networkthroughput/
---

I ended up upgrading the wiring in my place to CAT7 recently and I wanted to see if there was a noticeable performance difference to my previous cabling. This blog post won’t be a product comparison, but instead I’ll show how you can do network throughput testing at your own location.

There is a great package called `iperf3`. It’s in most repositories under Linux, and binaries for Windows and macOS exist as well.

For a more in depth tutorial [check out this post from Linode](https://www.linode.com/docs/networking/diagnostics/install-iperf-to-diagnose-network-speed-in-linux/).

_For the 5 second spiel…_

One one machine, start the server

```
iperf3 -s

```

On another machine connect to the server and begin testing the connection

```
iperf3 -c 192.168.0.2

```

You can also use the `-t` flag to specify the number of seconds you want to run the test for.
Django UserContextMixin
Tags: python, django, mixin
Published: 2019-12-12 13:21:24

---
title: Django UserContextMixin
published: true
tags: python, django, mixin
canonical_url: https://tech.serhatteker.com/post/2019-09/django-usercontextmixin/
---

If you want to get the currently `logged-in user` and use it—e.g at the top of every template, in class-based view it could be hard to achieve.

However there is an easy and pythonic/djangoic way to accomplish that: just use a `Mixin`. Actually `Django` framework consists of very wide range of `Mixins` such as `SingleObjectMixin` or `TemplateResponseMixin`. For more detail: [Django Class-based Mixins].

So now we can write our very own `Mixin` to do the job:

```py
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from django.views.generic.base import ContextMixin


class UserContextMixin(ContextMixin):
    """Get current `User` from request and add it to context"""

    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)
        user = self.request.user
        context['user'] = user

        return context
```

Above we inherit our `Mixin` from `built-in` `ContextMixin` class which can be examined below:

```python
class ContextMixin:
    """
    A default context mixin that passes the keyword arguments received by
    get_context_data() as the template context.
    """
    extra_context = None

    def get_context_data(self, **kwargs):
        if 'view' not in kwargs:
            kwargs['view'] = self
        if self.extra_context is not None:
            kwargs.update(self.extra_context)
        return kwargs
```

Then you can inherit it in your `Class-based view` like below:

```py
from .utils.views import UserContextMixin


class OrderCreateView(UserContextMixin, CreateView):
    template_name = "template.html"
    success_url = reverse_lazy("product:order")
    form_class = OrderModelForm
    extra_context = {'some_detail': 'Some Other Info'}

    …
```

So now you can use your `user context` in your view's other attributes. Also you can access it in your templates such as below:


```django
{% extends "app/base_site.html" %}
{% load staticfiles %}

{% block title %} Order {% endblock title %}

{% block content %}
…

User : {{ user }}
User Name : {{ user.name }}

…

{% endblock content %}
```

__*Pro Tip*__: Always inherit your `Mixin` before `Class-based View` classes.


All done!


[Django Class-based Mixins]: https://docs.djangoproject.com/en/2.2/ref/class-based-views/mixins/
Async functions always return a promise - Lets deep into the Async world
Tags: tutorial, javascript, showdev, webdev
Published: 2020-01-15 06:17:16

---
title: Async functions always return a promise - Lets deep into the Async world
published: true
tags: ['tutorial', 'javascript', 'showdev', 'webdev']
canonical_url: https://learnwithparam.com/blog/async-always-returns-a-promise/
description: Async await becomes an integral part of any modern application in JavaScript. We have used async for all asynchronous operation and return the promise ourself. But do you know, how async works? Let's see it in detail.
---

> I have my new FREE workshop on *API design for beginners using Node Js and MongoDB*. It is my first workshop, let's learn together. You can register for the workshop [here](https://www.eventbrite.com/e/api-design-for-beginners-using-node-js-and-mongodb-english-tickets-89601978931) 

Async functions are a way to make the asynchronous operation synchronously by waiting for the response. Let's see it in the example straight away,

```js
// Normal async function - Returning promise
const getCats = async () => {
  return new Promise((resolve, reject) =>
    setTimeout(
      () =>
        resolve([
          {
            name: 'tiger',
          },
          {
            name: 'jimmy',
          },
        ]),
      2000
    )
  );
};

// Self envoking async function
(async () => {
  console.log(getCats()); // Promise { <pending> }
  const cats = await getCats();
  console.log(cats); // [{ name: 'tiger' }, { name: 'jimmy' }]
})();
```

As you can see, we are returning a promise in our example.

Now lets see the next example by returning direct JSON array,

```js
// async function - Returning JSON
const getCatsJson = async () => {
  return [
    {
      name: 'tiger',
    },
    {
      name: 'jimmy',
    },
  ];
};

// Self envoking async function
(async () => {
  console.log(getCatsJson()); // Promise { [{ name: 'tiger' }, { name: 'jimmy' }] }
  const catsJson = await getCatsJson();
  console.log(catsJson); // [{ name: 'tiger' }, { name: 'jimmy' }]
})();
```

As you can check the console log, even though we returned a JSON object from the async function. It was wrapped as a promise. So we still need to await and resolve the promise.

You can always resolve the async without await using promise way,

```js
getCatsJson().then(console.log); // [{ name: 'tiger' }, { name: 'jimmy' }]
```

You can check the examples here,


{% codesandbox async-promise-return-value-fpis9 %}


Hope, this helps you to understand how async returns the value by wrapping it as a Promise 😋

> Follow me on [twitter](https://twitter.com/learnwithparam). I share my reading list and short tips on twitter
Finally created my first app
Tags: android, java, mobileapp
Published: 2019-08-30 21:57:29

---
title: Finally created my first app
published: true
description: Note Keep
tags: android,java, mobile app
---

So this is my first and official app
 https://play.google.com/store/apps/details?id=com.notekeep.andrekelvin.notekeep

It's a note application with a reminder feature please feel free to download and give review thanks

Here is the GitHub feel free to dig in

https://github.com/AndreKelvin/NoteKeep
Is JavaScript the most confusing programming language?
Tags: javascript, discuss, webdev, programming
Published: 2019-08-30 21:56:25

---
title: Is JavaScript the most confusing programming language?
cover_image: https://thepracticaldev.s3.amazonaws.com/i/i1kxucldsfwlcxb6rsk5.jpg
published: true
description: People often say that JS (and implicitly NodeJS) is confusing because of its magic power. Moreover, JS landscape changes over time and changes fast.
tags: javascript, discuss, webdev, programming
---
People often say that JS (and implicitly NodeJS) is confusing because of its magic power. Moreover, JS landscape changes over time and changes fast.

That is something one should accept if one is doing JS. Nobody uses call-backs anymore, for instance, and even promises are not explicitly declared most of the time.

There are a lot of frameworks and a lot of packages one can use - especially on the frontend.

One project can be completed in several entirely different stacks, and each stack might be different enough that we, developers, can not switch between them easily.

The end result, however, is that nobody from QA, management or the customer would see (nor care) about the differences between using the different stack - the results would be similar enough.

Is it any surprise that people complain about JavaScript?

Complaining is what people love to do. The more complaints you hear, the more you know the language is being used. If the complainers get severe enough, a new language will sprout from the old one. Hence, TypeScript (which precompiles down into JavaScript).

All in all, I don't think that JavaScript is any more confusing than any other language or platform. It’s just changing and evolving a lot right now. And that’s good!

Speaking of constant change. An excellent place to understand how to deal with change, solve old (architecture, e2e testing,  dev tools, etc.) and new (accessibility, Typescript integration, AI-chatbot adoption, etc.) problems are to get insights from different applied approaches throughout JS conferences. 

**revo.js** is one of them! And they specifically focus on the ever-changing nature of software development! Don't miss out and get your regular discounted ticket with the promo code:

[REVOJS_ILONACODES](http://bit.ly/revojs-ilonacodes)

(there are only two days left for the regular tickets)

___

_Photo by timJ on Unsplash_
I Made Another Website
Tags: gatsby, react, firebase
Published: 2019-08-30 21:50:56

---
title: "I Made Another Website"
description: "In which I gush about Frontend Mentor"
tags: ["Gatsby", "React", "Firebase"]
published: true
---

## I Can't Help Myself

I stumbled onto [Frontend Mentor](https://www.frontendmentor.io) a couple of weeks ago and I've finally gotten around to doing a challenge. 

[Frontend Mentor](https://www.frontendmentor.io) is a website that streamlines the process for practicing front end developers to create real projects. I've spent a lot of time lately working with Material Design/Material-UI and I felt like some of my CSS skills were getting rusty. I'd been using MD because it kept me from spending hours and hours trying to figure out exactly how I wanted to position components. Frontend Mentor does the same thing by giving me an already thought out design.

For my first challenge I went with one of the "Newbie" designated designs just to see what it was all about. And I can say that I love it and will be doing more of these. The downloaded file gave me all the images and font choices and the colors that I needed to create the design.

All I had to do was copy and paste it into my Gatsby hello-world starter and get to work creating components.

Check out the [Design!](https://beta.frontendmentor.io/challenges/intro-component-with-signup-form-5cf91bd49edda32581d28fd1)

And my (not quite finished) [Result!](https://alilynnefrontendmentor.firebaseapp.com/)

Hoping to get to doing another one soon where I walk through my process of breaking the project down into parts and getting started.