teleren/devto huggingface dataset:
Add a Video to Your Hugo Website
Tags: hugo, webdev, tutorial, to
Published: 2020-09-22 00:59:03

Hugo is the world’s fastest framework for building websites. It is easy to get started, and has a fair number of customization available out of the box. It is a great choice for content creators who don't want to spend a lot of time on HTML and CSS, but would rather focus on delivering their product to the audience. 

Video is one of the most common forms of the media content. Out of the box, Hugo allows for including YouTube and Vimeo resources. There is no real support for the video files hosted externally.

Today, I will show you how to overcome this issue using Hugo [shortcodes](https://gohugo.io/templates/shortcode-templates/).

First, let's define what are the shortcodes:

> Shortcodes are means to consolidate templating into small, reusable snippets that you can embed directly inside of your content.

To create a new shortcode, place its template in the `layouts/shortcodes`. In my case, I created the following template at `layouts/shortcodes/video.html`

```html
<div class="container">
  <div id="player-wrapper" class="{{ .Get 1 }}"></div>
</div>

<script 
  type="text/javascript" 
  src="https://cdn.jsdelivr.net/npm/@clappr/player@latest/dist/clappr.min.js"
>
</script>

<script>
  var playerElement = document.getElementById("player-wrapper");

  var player = new Clappr.Player({
    source: {{ .Get 0 }},
    mute: true,
    height: 360,
    width: 640
  });
  
  player.attachTo(playerElement);  
</script>
```

Directives `{{ .Get 0 }}` and `{{ .Get 1 }}` will instruct Hugo to inject the first and second arguments of the shorthand into appropriate locations. I used [Clappr](https://github.com/clappr/clappr) as a media player, but you are free to use any of the other JavaScript players available. The overall flow remains the same.

Now, I can create a new Markdown document, and use the newly created shorthand. Two arguments has to be provided: link to the video, and CSS class to apply to the container wrapping the video element. 

```md
---
title: 'Hello Video'
date: 2020-09-20T19:02:50-07:00
draft: false
---

Look what I can do!

{{< video "http://clappr.io/highline.mp4" "my-5" >}}
``` 

That's it! If you weren't able to follow along, the [source code is available on my GitHub](https://github.com/aakatev/hugo-video-starter). For the example of the final result follow [this link](https://aakatev.github.io/hugo-video-starter/example/).
From Zero to Cloud with Java
Tags: azure, java, beginners, serverless
Published: 2020-09-22 00:37:17

{% youtube XHdRMQ8ZzpI%}

#### 📺 026 - Bruno Borges 🎙️ Jason Hand

In this episode of All Around Azure, Jason catches up with old pal Bruno Borges as they discuss what's new in the world of Java as well as how to get started developing in Java (in the cloud).

Along the way, we'll explore a number of tools and resources to assist developers to get started with Java on Azure.

### Useful Links

🔗 [Java Tutorial](https://code.visualstudio.com/docs/languages/java?WT.mc_id=allaroundazure-devto-brborges)

🔗 [Spring Initializer](http://start.spring.io/)

🔗 [GrallVM](https://www.graalvm.org/)

🔗 [Java on Azure](https://code.visualstudio.com/docs/languages/java?WT.mc_id=allaroundazure-devto-brborges)

🔗 [Azure for Java developer documentation](https://docs.microsoft.com/en-us/azure/developer/java/?WT.mc_id=allaroundazure-devto-brborges)

🔗 [Azure Functions Java developer guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=consumption&WT.mc_id=allaroundazure-devto-brborges)

### Learn more about Bruno Borges

🔗 [@BrunoBorges](https://twitter.com/brunoborges)

🔗 [Bruno's Bio](https://developer.microsoft.com/en-us/advocates/bruno-borges)

### Find Us On

📺 [Twitch](https://www.twitch.tv/microsoftdeveloper)

🔗 [Twitter](https://twitter.com/jasonhand)

☁️
Fill PDF
Tags: javascript, discuss
Published: 2020-09-22 00:21:07

Hi! Basically I want to know what uses the community for generating `*.pdf` files. My use cases is the following one: the user fills a form (an invoice) and has to be able to "Save as PDF" - [found this React package](https://www.npmjs.com/package/react-to-print) - but also has to be send (server-side) to a recipient throw Whatsapp (Twilio API or custom). Thanks by the way
Reflecting on a Year of Code
Tags: codenewbie, beginners
Published: 2020-09-22 00:08:33

*I just realized that it has been a year since I REALLY started to code! Last September, I enrolled in Flatiron School's Online Software Engineering Bootcamp.  I graduated in mid-April, and started a new job in July.* 

![Imgur](https://i.imgur.com/9xnq9lM.png)

As I look back at my GitHub commit history, I can trace the path of my year. I was a part-time student from September through December, and I can see that show up in light green. I can see my two-week hiatus from coding across the December holidays, when the kids were out of school. I can see the darker green contributions across January and February, when I switched into the full-time program.

And then the year got interesting...I can see my activity dropped in mid-March, which was when the schools shut down, and I started balancing full-time homeschooling for my two boys on top of tackling the full-time bootcamp schedule. I can see my activity increase again in April, when my husband was laid off for a few valuable weeks, enabling him to take over the homeschooling duties while I was able to finish up at Flatiron and graduate. 

I can see my activity post-graduation, as I again balanced the full-time homeschooling with a job search, while also trying to keep up with my blogging, side projects, and teaching myself data visualization. See that blank week in May? That was when I was computer-less, after my son knocked over a cup of coffee into my laptop, while showing me his daily math work!

July brought a new job, and August brought a move to a new fixer-upper house. September brought a new school year, with the kids finally back to in-person school...at least for now. 

One year in, I'm reflecting back on what I've achieved, breaking into a new career while parenting through a global pandemic. Could I have accomplished more, under a more normal set of circumstances? Yes! Am I happy with what I did accomplish, despite the unexpected challenges? Yes! One year in, I'm looking forward to continuing to learn new frameworks and approaches, and continuing to periodically write about what I'm exploring. 

See you in Year Two!
Common myths about coding you should ignore
Tags: codenewbie, 100daysofcode, womenintech, productivity
Published: 2020-09-22 00:04:55

So today I'm gonna be busting myths about programming because I hear a lot of people view coding as a way that isn't reality.
Let's start:

### • Programming requires a lot of math
A lot of people think that to become a good programmer you need to become good at math and this makes a lot of people that want to enter the field of programming very discouraged. For general programming, you need basic math like; **addition**, **subtraction**, **division**, **multiplication**, and other basic math we've learned. Just know that there are some areas of **programming** that require **more math**. 

### • It's a young man's game
It doesn't matter if you are **30, 40, 50.** When it comes to coding, **age is not a factor**. Anyone can learn to code. What matters is how **much effort** you are willing to put into it. 

### • It's for the anti-social
Wrong, **coding is for everyone**. During coding, not only are you **communicating with your computer** but you would also need to communicate with other developers when you need help with your code.  A career as a developer is a **very social one**. While working on projects either in your team or by yourself, you will need to **exchange thoughts** and ideas with others. Surely you will spend a good amount of your **time-solving problems by yourself**. All coding projects involve a great deal of intense logical thinking and brainstorming but when you need help there would always be a community of your fellow developers to help you.

### • I need to be very smart to learn to code
What matters about **coding** is your **motivation** and **hard work**. To become a **better programmer** what matters most is your **consistency**. That is why I advise new programmers to participate in the **100DaysOfCode challenge**, it helps to **increase consistency** and **familiarity** with **programming**.

### • I need special qualifications to get into coding
This assumption could not be further from the truth. What you need is basic **computer skills** like how to use your mouse, typing, and others. The truth is that it's actually when you **start coding** that you'll probably learn more about what you can do with your computer. 


### Final thoughts 
For any myth I missed out, **please drop it in the comments**. 

My advice is to ignore these myths because they could be discouraging which is not good for your mental state. Coding is an insanely valuable skill to learn and it could change your life for the better. **Don't hesitate to learn it**.

**Feel free to check out my socials:** 
- [Twitter](https://twitter.com/mr_codeslinger) 
- [Instagram](https://www.instagram.com/mr_codeslinger/)

**GOOD LUCK**  👍
Github CLI 1.0
Tags: githubapi, git, github, terminal
Published: 2020-09-22 06:34:04

---
title: Github CLI 1.0
published: true
date: 2020-09-22 00:03:32 UTC
tags: githubapi,git,github,terminal
canonical_url: https://medium.com/nerd-for-tech/github-cli-1-0-3ab9888de77
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/13lgnmhgr7qmy1wi4vx6.png
---

**GitHub** is like a Bank to Developer, Where you can store all important code in it and use it whenever and wherever. You might as well know that it offers the distributed version control and source code management functionality of Git.

GitHub CLI is Terminal Interface. Where you can interact with your code on GitHub right from Terminal. This saves few clicks and makes Developer focus less distracted.

So, GitHub launched GitHub CLI. I want to be clear here **GitHub CLI is not replacement of Git.** GitHub just bringing their services to your Terminal.

You might say that “Hey, Mahesh! I’m already doing everything on terminal”. Of course, you do but GitHub CLI makes that experience now more feasible and flawless. For example, now you can create or resolve issues raised in your GitHub right from your terminal.

They calling it as gh. You need to start command line with starting gh.

### **Installation:**

GitHub CLI is available on Windows, mac OS, Linux

#### **Windows :**

- You can download directly from Link [here](https://github.com/cli/cli/releases/download/v1.0.0/gh_1.0.0_windows_amd64.msi)
- Download it and Open the file you downloaded.
- Installation Done

#### **mac OS :**

- `gh` is available via Homebrew and MacPorts.

Via brew

- `brew install gh` - Install
- `brew upgrade gh` - Upgrade

Via MacPorts

- `sudo port install gh` - Install
- `sudo port selfupdate && sudo port upgrade gh` - Upgrade

#### **Linux :**

```
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository <https://cli.github.com/packages>
sudo apt update
sudo apt install gh
```

So Installation Done, Next step is..

### Authentication

We need to authentication GitHub CLI with GitHub Server

`gh auth login` - for logging in

**Basic Commands to get Started with GitHub CLI:-**

`gh repo clone @username/@reponame` - to clone a Public Repo

`gh pr create` - to create a Pull Requests

`gh pr diff` - to view difference Pull Request and Master

`gh pr merge` - to merge a Pull Request

`gh pr checks` - to check all test cases are passing

`gh issue status` - to know opened issues for you

If you’re Open source contributor and want to Contribute to GitHub CLI. Contribute here 👉🏻 [cli/cli](https://github.com/cli/cli)

This is it. Hope this post is helpful to you!

You can check out my recent post on **How to Secure API token** and more

{% link https://dev.to/maheshthedev/how-to-secure-api-token-1end %}
{% link https://dev.to/maheshthedev/5-telegram-channels-for-data-science-enthusiast-12ee %}

* * *
Thanks for Reading, This is Mahesh Sv(`MaheshtheDev`) signing off.
How to check whether a data or an object is a Buffer in Node.js?
Tags: node
Published: 2020-09-22 00:00:00

---
  title: How to check whether a data or an object is a Buffer in Node.js?
  published: true
  tags: Nodejs
  date: Tue Sep 22 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/check-if-buffer-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-014493aa8b775f920b5e5c764a5afc75.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/check-if-buffer-nodejs)
  
To check whether some data or an object is a `Buffer`, you can use the `isBuffer()` method in the global `Buffer` class in Node.js.

```javascript
// a buffer
const buff = Buffer.alloc(10);

// check whether buff object is
// an instance of Buffer class
const isItBuffer = Buffer.isBuffer(buff);

console.log(isItBuffer); // true
```

- The method returns boolean `true` if it is an instance of `Buffer` class and `false` if not.

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

---
Seriously though, what's the problem with passphrases???
Tags: talesofabeginner
Published: 2020-09-21 23:53:06

So, I've been trying to figure out why my docker login does not work (yep, I was using my username all the time, not the email) then I find out that it wasn't working because I had commited the unthinkable crime of using passphrases and not passwords! Not only that but my passphrase had non-existent latin characters like á, é, í, ó, ú! 
I mean what are those some kind of alien writing never seen on Earth's history? Some fragment of that Zodiac Killer writings? What IS latin anyways??

Seriously though, you would have thought that no one in their sane mind would've been using passwords like "@$t&r!x!" or "!QazxsW@" or even better "8zMK.W&`bLbU){s+" (thanks passwordgenerator.net for that one) since the 2000's but, no. 
I could even understand why a normal person would've though that a password - oops - passphrase like "moonlight flying horse" would not be safe but, when an amazing software designed by pro devs does not accept that, not even pushing one of those depressing messages like "Your password contains forbidden characters" on my screen, you really start to question things.

From what I understand a passphrase like the one above is actually more secure because it has lots of entropy (please correct me if I'm wrong - I'm not a security expert), but it is also easier to remember. So why is Google suggesting passwords like y&FhHL5a?^?4f6[/? (The question mark is not part of it).
Oh, and if you forget it, here's a "HINT" - yelp & FRUIT hulu HULU LAPTOP 5 apple ? ^ ? 4 fruit 6 [ / .

I hate to be the noob who keeps pinpointing and complaining about everything that's wrong with the industry today, but, it is really fun to write this!! So here goes one more: I don't know if this would break all technology on Earth and send us back to the middle ages, but I wouldn't mind a little more UTF-8 support on the software we use everyday.

By the way, if you're wondering if I got Docker to accept me, I did! By using a proper password.
Ajax and XHR using plain JS
Tags: xhr, javascript, ajax
Published: 2020-09-23 16:44:09

---
title: Ajax and XHR using plain JS
published: true
date: 2020-09-22 00:00:00 UTC
tags: XHR,JavaScript,AJAX
canonical_url: https://www.loginradius.com/engineering/blog/ajax-and-xhr-using-plain-javascript/
---

Learn the concept of AJAX and XHR in JavaScript, the benefits of AJAX, and how easy it is to implement the AJAX into our web application.

   
[Read On](https://www.loginradius.com/engineering/blog/ajax-and-xhr-using-plain-javascript/)
Azure Powershell - Simplify your multi subscriptions scripts
Published: 2023-09-13 15:42:16

---
title: Azure Powershell - Simplify your multi subscriptions scripts
published: true
date: 2020-09-22 00:00:00 UTC
tags: 
canonical_url: 
---

When you have multiple Azure subscriptions that communicate with each other, it is often necessary to make scripts using multiple subscriptions. The simplest and most documented way is as follows:

```
Connect-AzAccount #With an account with access to all subscriptions

$hubSubscriptionId = "...."
$spokeSubscriptionId = "...."

Select-AzSubscription -SubscriptionId $hubSubscriptionId

Get-AzResource ....

Select-AzSubscription -SubscriptionId $spokeResourceId

Get-AzResource

```

So yes, it is convenient to easily change context via a single line of powershells, but when it comes to retrieving a single piece of information on the second subscription, it may be necessary to change context every 2 lines. And I’m not even talking about if you want to perform several actions in parallel.

The prerequisite for this to work is to have Azure authentication on multiple accounts, which you have by default with this command :

```
# With user login
Connect-AzAccount

# With SPN Login
$Credential = Get-Credential
Connect-AzAccount -Credential $Credential -Tenant 'xxxx-xxxx-xxxx-xxxx' -ServicePrincipal

```

For example if I want to retrieve information from the virtual network peerings to my vnet of an A subscription, I can do a script like this :

```
$vnetHub = Get-AzVirtualNetwork -ResourceGroupName $rgName -Name $vnetName

foreach ($peering in $vnetHub.VirtualNetworkPeerings) {
  $remoteVnet = Get-AzResource -Id $peering.RemoteVirtualNetwork.Id -ExpandProperties

  Write-Host $remoteVnet.Properties.addressSpace.addressPrefixes
}

```

And of course it works even if my RemoteVirtualNetwork is in another subscription or in the current one.

This is a little trick, which I think is good to know especially for Powershell fans.
Jumping into Figma
Tags: design, codenewbie, beginners, womenintech
Published: 2020-09-21 23:28:50

I feel like I worked a lot of things last week. I continued on some JavaScript projects on [#JavaScript30](https://javascript30.com/), dove into React Tutorials on [Scotch.io](https://scotch.io/starters/react/getting-started-with-react-2019-edition?ref=home-start-here), and found out about this cool designing tool [Figma](https://figma.com/) (Thanks @chrisoncode).

I really wanted to talk about Figma and share how cool it is! The past couple of days, I have been messing with it to build a prototype of a personal website. I figured that I learned best by doing and what better way to do that by building a personal website incorporating everything I learned or am learning. 

Take a look at this!

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

It's super user friendly including layering and grouping which is convenient for editing. It also includes a prototype feature which allows you to link frames using mouse events like `onclick` and `onmouseover`. 

After I play around with it a little more and figure out my final design, then I can get to building code to make it interactive. Designing is super fun for me. So this is very exciting. 

**Last Week’s Accomplishments:**
 - Continued with JavaScript projects on [#JavaScript30](https://javascript30.com/)
 - Started React Tutorials on [Scotch.io](https://scotch.io/starters/react/getting-started-with-react-2019-edition?ref=home-start-here) 
 - Started to frame by personal website using [Figma](https://figma.com/)

**On My Mind:**
- What are some cool designing apps you've grown fond of?

Until next time,
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h4as8ppg0u73on7y8677.png)
Current Status
Tags: webdev, python, javascript
Published: 2020-09-21 23:26:19

I couldn't think of anything to write this week, but thought I would post a general update:

1) I've been learning Python🐍 and it's been going well. Currently, learning about **Strings**, next up is **Lists**.

2) Decided to begin my React Native project. I'm not sure how it will go, but want to finish it before November. I'll attempt to document the process, so keep an eye out.

3) Recently bought *[Atomic Design by Robert Frost](https://atomicdesign.bradfrost.com/)*. I plan to post a review of it soon.

4) I was awarded a copy of *[Learn Eleventy from Scratch by Andrew Bell](https://hankchizljaw.com/)*. Furthermore, I'll post a review of this course too. Stay tuned.

Time management and planning will be key to this being successful. Good luck everyone!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8cckljotdiiah25wrxvy.jpg)
*Cat Tax: Miss Meow Meow*
>NOTE: My desk isn't messy anymore :)
LGPD - Parte III - Princípios
Tags: security, lgpd
Published: 2020-09-21 22:47:04

Com a implementação da LGPD, todo tratamento de dados pessoais deverá, **obrigatoriamente**, seguir os seguintes 10 princípios:

### I - Finalidade
Todo tratamento de dados deve ser feito para propósitos legítimos, claramente informados ao titular, sem possibilidade de, posteriormente, utilizar os mesmos dados para um propósito diferente.

### II - Adequação
Deve-se garantir que realmente os dados coletos estão sendo tratados de forma compatível com as finalidades informadas ao titular.

### III - Necessidade
Deve-se limitar os dados e os seus tratamentos sempre ao mínimo necessário para cumprimento de suas finalidades.

### IV - Livre Acesso
O controlador deve garantir aos titulares uma forma facilitada e gratuita sobre a forma e duração do tratamento dos dados, assim como quais são os dados pessoais que estão sendo tratados.

### V - Qualidade dos Dados
Deve ser garantido ao titular a exatidão e clareza dos dados, assim como uma forma de atualização deles conforme necessidade.

### VI - Transparência
Os titulares devem ter facilmente, de forma clara e precisa, acesso sobre quais tratamentos estão sendo realizados com os dados, e quais são os operadores dos tratamentos.
Esse princípio garante os segredos comerciais e industriais.

### VII - Segurança
Os controladores e os operadores dos dados devem utilizar de medidas técnicas e administrativas que garantam a proteção dos dados de acessos não autorizados e de situações acidentais ou ilícitas (perda, alteração indevida, etc.).

### VIII - Prevenção
Devem ser adotadas medidas para prevenir a ocorrência de dados aos dados durante o seu tratamento.

### IX - Não Discriminação
Os dados tratados não devem ser utilizados para fins discriminatórios ilícitos ou abusivos.

### X - Responsabilização e Prestação de Contas
Tanto o controlador quanto o operador devem conseguir demonstrar e comprovar o cumprimento das normas, incluindo a eficácia dessas medidas.

*No próximo artigo trarei os requisitos definidos na lei para o tratamento de dados*