teleren/devto huggingface dataset:
Running bash commands with git alias
Tags: git, bash
Published: 2021-05-08 13:24:14

---
title: Running bash commands with git alias
published: true
date: 08/05/2021
tags: git,bash
canonical_url: http://blog.gnclmorais.com/running-bash-commands-with-git-alias
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amcf43xc5es1uoiy9cvc.jpeg
---

This is a quick tip I learned recently and it allowed me to improve my `git` workflow a bit more.

Here’s a new part of my `.gitconfig`:

```bash
[alias]
    main = !git checkout main && git pull --no-tags
    sync = !git main && git switch -
    fuse = !git sync && git rebase main

```

This week I added these three alias to my `.gitconfig` but, if you notice, they are not “regular” alias. **The `!` at their beginning tells Git that these are not alias to Git commands, but rather bash commands.**

This gives you a simple but powerful way to chain executions, so I created three related alias that I can call depending on my goal:

- If I finished working on a branch and I want to get back to `main` and start with the most recent codebase, I’ll run **`git main`**. Notice the `--no-tags`, this is motivated by working on a _large_ monorepo and not needing all the tags of the packages we keep updating;
- If I’m working on a branch and I want to quickly get any changes made to our `main` branch but come back to the branch I’m in right now, I’ll call **`git sync`**. As a note, `git switch -` gets you back to the branch you were before you moved to the current branch you are now;
- Finally, if I want to bring the current branch I’m at up to speed with the latest code we’ve shipped, I’ll use **`git fuse`**. It will do everything I described on the other commands so far _and_ rebase our `main` branch onto the current branch I’m at.


---

_Cover image by [@yancymin](https://unsplash.com/photos/842ofHC6MaI)_
Azure Functions University - HTTP Lesson (PowerShell)
Tags: azure, serverless, programming, powershell
Published: 2022-03-16 20:13:31

---
title: Azure Functions University - HTTP Lesson (PowerShell)
published: true
date: 2021-05-08 00:00:00 UTC
tags: azure, serverless, programming, powershell
canonical_url: https://blog.marcduiker.nl/2021/05/08/azfuncuni-http-lesson-powershell.html
series: Azure Functions University
---

![Http Lesson PowerShell](https://blog.marcduiker.nl/assets/2021/05/08/AzureFunctionsUniversity_HTTP_Lesson_PowerShell.png)

Hi serverless friends, we have a new Azure Functions University lesson for you! In this lesson we will learn how to use the HTTP trigger in Azure Functions written in PowerShell.

<!--more-->
## Lesson

You can find the lesson on GitHub: [HTTP Trigger (PowerShell)](https://github.com/marcduiker/azure-functions-university/blob/main/lessons/PowerShell/http/README.md).

And you can watch the video on YouTube:
{% youtube uPzpfAosmZ8 %}

The lesson consists of the following exercises:

| Nr | Exercise |
| --- | --- |
| 0 | Prerequisites |
| 1 | Creating a Function App |
| 2 | Changing the template for GET requests |
| 3 | Changing the template for POST requests |
| 4 | Changing the name of the Request parameter |
| 5 | Change the route for a custom greeting |
| 6 | Homework |
How to check if a string is a valid IP address in JavaScript?
Tags: javascript
Published: 2021-05-08 00:00:00

---
  title: How to check if a string is a valid IP address in JavaScript?
  published: true
  tags: JavaScript
  date: Sat May 08 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/check-if-string-is-valid-ip-address-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-ed86a0c8a8631d8cb0b0a6dbb9ed85d2.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/check-if-string-is-valid-ip-address-javascript)
  
To check if a string is a valid IP address (IPv4) in JavaScript, we can use a regex expression to match for the allowed number range in each of the four decimal address sections.

### TL;DR

```js
// Regular expression to check if string is a IP address
const regexExp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/gi;

// String with IP address
const str = "192.168.5.68";

regexExp.test(str); // true
```

This is the regex expression for matching almost all the test cases for a valid IP address in JavaScript.

```js
// Regular expression to check if string is a IP address
const regexExp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/gi;
```

Now let's write a string with IP address like this,

```js
// Regular expression to check if string is a IP address
const regexExp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/gi;

// String with IP address
const str = "192.168.5.68";
```

Now to test the string, we can use the `test()` method available in the regular expression we defined. It can be done like this,

```js
// Regular expression to check if string is a IP address
const regexExp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/gi;

// String with IP address
const str = "192.168.5.68";

regexExp.test(str); // true
```

- The `test()` method will accept a `string` type as an argument to test for a match.
- The method will return boolean `true` if there is a match using the regular expression and `false` if not.

See the above example live in [JSBin](https://jsbin.com/zasewijaja/2/edit?js,console).

If you want this as a utility function which you can reuse, here it is,

```js
/* Check if string is IP */
function checkIfValidIP(str) {
  // Regular expression to check if string is a IP address
  const regexExp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/gi;

  return regexExp.test(str);
}

// Use the function
checkIfValidIP("192.168.5.68"); // true
checkIfValidIP("654.23.1.2"); // false
```

That's all! 😃

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

---
Reader question: "What do you do for interview prep?"
Tags: interview, career
Published: 2021-05-10 19:00:42

---
title: Reader question: "What do you do for interview prep?"
published: true
date: 2021-05-08 00:00:00 UTC
tags: interview,career
canonical_url: https://jhall.io/archive/2021/05/08/reader-question-what-do-you-do-for-interview-prep/
---

I was just asked: “What do you do for interview prep?”

I think this is a great question. Although what _I_ do for interview prep is likely different than what _you_ should do for interview prep, since we’re likely in different stages of our careers.

1. **Read up on the company.** Don’t spend too long. 10 or 15 minutes is enough. visit their web site. Understand their core business. If you _can’t_ determine their core business that’s okay, and it makes for a great question during the interview! (This _has_ happened to me, with early-stage stealth startups)
2. **Know your deal-breakers.** If there are any absolute deal-breakers for you, know them, and ask about them in the first interview if possible. Not willing to relocate? Need a 4-day schedule? Do you demand a conference budget? Do you require an in-office masseuse? Ask about these things.
3. **Have a list of standard questions prepared.** Everyone’s list will be different. Some common ones I ask: What tech stack does the company use? How do you handle deployments? What project management or agile methodology do you use, if any? What’s the main reason I should _not_ work here?

Notably, one thing I _don’t_ do is spend time writing practice code, or “cramming” for a technical interview. Personally, I’ve never felt a need to do so. Second, I don’t think it’s helpful (or especially honest). I want the interviewer to get an honest impression of who I am and what I know. I feel like “cramming” is designed to give a false impression.

Most important: Remember that you’re interviewing the company, too! **Ask anything that could help answer the question “Do I want to work here?"**

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Earn more storage space on OneDrive for free
Tags: microsoft, onedrive, storage
Published: 2021-05-07 22:57:10

#What is Onedrive?
> OneDrive is a file hosting service and synchronization service offered by Microsoft for its users.

#How much Strorage space do I have?
Depending on the type of your subscription, Microsoft offers you different amounts of space.
We're here to talk about the free plan which is what you get when you first create a Microsoft account (`@outlook.com` or `@hotmail.com`).
With this plan, all you get is **5GB**, which is, in most cases, not sufficient in case you depend a lot on cloud storage services, or you prefer to store your documents and data up there.
# How can I increase my storage space?
Glad you asked, Microsoft itself will ask you to go premium and push you into buying more space with a Microsoft 365 subscription!

![Onedrive Window](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jw1detq8smrfnzobc9qx.png)
Whilst paying for a premium subscription will open your access to 100 GB, 1TB or 6TB of storage space, there's a way to get up to 10 GB of free storage.

![Subsciption Options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/teu3vtc7ebjwxk2yzi6j.png)

Open your Web based Onedrive and click on the Settings button and then to Options or simply click on this link ["Manage Storage"](https://onedrive.live.com/?v=managestorage), after that you'll find a section called Your additional storage and the refereal bonus that says (0% acheived)

Next thing to do is click on Earn more that will pop up a window with different ways to share your referral link
Share that link with your friends and family and you'll earn 500MB for each person clicking your link and registering for Onedrive for the first time. and they also get a bonus of 500 MB.
![Earn more](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osp6xke4qdlgrocefv04.png)
 
# Extra out of charge 500 MB
If you don't have a Microsoft account yet or want to use Onedrive for the first time, use my referral link [https://onedrive.live.com?invref=62ae940e77f9bed2&invscr=90](https://onedrive.live.com?invref=62ae940e77f9bed2&invscr=90) and you'll get extra 500, I get extra 500, everyone happy 😄 .

#Final words
Don't hesitate to leave any questions you may have for me in the comments. I'll be pleased to reply and subscribe for more interesting content like this one.
React JS beginner fundamental concepts 
Published: 2021-05-07 22:49:55

 
1. What is react?
React is a JavaScript Library . It not exactly a framework. This library build user interface. It's tool build a UI components. React is using Front end in website. React can focus in only client site in website.

2. What is JSX??
JavaScript XML is short form JSX. We write in react pure vanilla JavaScript because react is JavaScript library. But need HTML for create website. We can't write in JS file. But JSX file write in JS file. JSX file almost looking 90% same HTML. JSX is using a transpolar which is known as BABLE. BABLE JSX file compile in Html. We use JSX in react easily building our UI.

3. What is Components?
One website has to many section. They are many section similar in look de deferent  in data. Some times we see many section looks are same but data is deferent . Then same code repeat in code. By using react component we can't repeat our codes. That is the main beauty of a component.

4. What is Virtual Dom?
React is work in virtual dom. A virtual Dom object is the same properties as real Dom but it has the power to change the real thing that I want to change. Original Dom manipulating is slow than virtual dom. Each time we change something in our JSX file, all the objects that are there in the virtual DOM gets updated.
5. What is props ?
Some times we need pass data one components to other components. Props is a method where we can pass data from parent component to child component. Props are so effective for small-type applications.

6. What is Context API?
The React Context API is a way for a React app to effectively produce global variables that can be passed around. This is the alternative to "prop drilling" or moving props from grandparent to child to parent.

7. Condition Rendering
Conditional rendering is a condition-based render function. Some we need like if the user is boys show something else the user is girls then shows another thing. In this case, we use conditional rendering & show output to the user.
8. What is State?
Some times we need set a data anywhere and after need to use. State is important part of react. In this case, we can use the useState function, we can use and set data easily.

9. React Fragment
Fragment is a common pattern in react is for a component to return multiple elements. React also provides a component for rendering multiple elements without a wrapper.

10. React Hooks
A hook in a React component is a call to a special function. They let you use state and other React features without writing a class. Hooks have a dedicated docs section and a separate API reference :
Basic hooks 
useState
useEffect
useContext

Other hooks :
useReducer
useCallback
useRef etc.
Day 362 : Leaving It Too Late
Tags: hiphop, code, coding, lifelongdev
Published: 2021-05-07 22:16:33

_liner notes_:
- Professional : Nice productive way to end the week. Had a team meeting and got some really good news. Started editing together the screen recordings I made during the week. Found a format issue with one of the tutorials and did a pull request for a fix. Yeah, not a bad day.

- Personal : Didn't really do much of anything last night. Ate dinner and watched some YouTube videos and went to sleep. haha.

![View into a valley in Chonggu Grassland, China with some grassland in the foreground leading to hills with a forest and snow covered mountains in the distance.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uqodcfobwh19rx9kka7j.jpg)

It's Bandcamp Friday so I'm going to be buying a bunch of tracks. Put together the radio show. And work on my side project. I want to get the front end site done and then work on the notifications part. Definitely want to get in an episode of "Yasuke". Oh and I got a date for my next talk / meetup and want to have this side project launched by then. Can't be leaving it too late. Need to get it up and out there.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube C5R2sIgh4EE %}
Register Global components in Vue 3
Tags: vue, javascript
Published: 2021-05-07 21:57:24

**UPDATE**: there is an [official guide](https://vuejs.org/guide/components/registration.html#global-registration) now.

Vue 2 docs has a great [way](https://vuejs.org/v2/guide/components-registration.html#Automatic-Global-Registration-of-Base-Components) to automatically register base components.
Fortunately this keeps working in Vue 3 with minimal changes.

## Get started

As soon as we start a project using vue-cli and Vue 3 we will see something like this in the `main.js` file:
```js
createApp(App).mount('#app')
```

Let's change it up a bit to add our base components:
```js
const app = createApp(App)

app.mount('#app')
```

Before **mount** the app we will add our registration.

Here we require all components that are inside `components` folder:
```js
const requireComponent = require.context(
  './components',
  true,
  /Base[A-Z]\w+.(vue|js)$/
)
```
If you prefer to have `folders` and `index.vue` files for components you need to change the regex:
```js
/Base[A-Z]\w+\/index.vue$/
```

Finally, you need to iterate over all components and register them using the Vue instance we assigned to `app` variable:
```js
requireComponent.keys().forEach(fileName => {
  const componentConfig = requireComponent(fileName)

  const componentName = upperFirst(
    camelCase(
      fileName
        .split('/')
        .pop()
        .replace(/\.\w+$/, '')
    )
  )

  app.component(
    componentName,
    componentConfig.default || componentConfig
  )
})
```

## Is this real life?
There is a [demo app](https://github.com/vilaboim/vue-3-global-registration) to show the real life implementation.
102. Binary Tree Level Order Traversal
(javascript solution)
Tags: algorithms, javascript
Published: 2021-05-07 21:38:55

###Description:
Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
// BFS
var levelOrder = function(root) {
    if(!root) return []
    const queue = []
    const output = []
    queue.push(root)
    while(queue.length) {
        // Remove all the current nodes in the queue and add each node's children to the queue
        const len = queue.length
        const row = []
        for(let i = 0; i < len; i++) {
            const cur = queue.shift()
            if(cur.left) queue.push(cur.left)
            if(cur.right) queue.push(cur.right)
            // Push the current node val to the row array
            row.push(cur.val)
        }
        // Push the current row array into the output array
        output.push(row)
    }
    return output
};
```
Newman
Tags: postman, newman, apitesting
Published: 2021-05-07 20:59:34

Newman nos permite ejecutar y probar sin esfuerzo colecciones de Postman directamente 
desde la línea de comandos(consola de windows)

1.Debemos instalarlo como cualquier otro paquete de node.

npm install -g newman

2.Si tenemos Newman y nuestras colecciones disponibles en nuestra máquina(luego de exportarlos desde postman). 
Para poder ejecutarlas utilizamos el siguiente comando:

newman run "ruta/nombre_coleccion.json"

3.Podemos hacer referencia en la ejecución si ha generado un entorno(environment)para que apunte al mismo

newman run “ruta/nombre_coleccion.json” -e “ruta/nombre_environment.json”

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

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kj7fcgykfv8xbddif10h.PNG)
Access your GitHub repo in VS Code
Tags: todayilearned, github, vscode, beginners
Published: 2021-05-07 20:54:16

Who has never been lost while browsing a repository on GitHub? I recently found a tool that caught my attention and has helped me daily to not get lost in my old codes.
<hr>

## GitHub1s
The project basically presents an easy way to access and view your Github repository as if it were inside the Visual Studio Code editor. To do this, simply add '1s' after 'github' in the repository url and press enter, as in the example:

![GitHub1s - Usage](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/vs-code-github1s.png)
<br>

### Demo
![GitHub1s - Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxlsocg2kelwvlfc3eu1.png)
<br>

### Cloud development
In addition to being able to view your entire project, you can also edit files, execute docker containers and create pull requests through integration with [GitPod](https://www.gitpod.io), to do this just click in "Develop your project on Gitpod" button in the status bar.

![Gitpod Status Bar](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/gitpod-statusbar.png)

It's also possible to use the tool for local development, to do this just take a look at the documentation [clicking here.](https://github.com/conwnet/github1s#readme)
<br>

### Extensions
To make it even easier it is possible to add extensions created by the community to access the tool more quickly:

![Extensions](https://camo.githubusercontent.com/70b5b3d373db4e1b55f8ed2981932a9f652b90ec8ed2179d2194a13f66d86d90/68747470733a2f2f692e696d6775722e636f6d2f4e584e547a37502e706e67)

Check the list of extensions [here!](https://github.com/conwnet/github1s#third-party-related-projects) And choose the one you like best.

<hr>

Was this tip useful? Comment if it helped you and share!
Acesse seu repositório do Github através do VS Code
Tags: todayilearned, beginners, github, tooling
Published: 2021-05-07 20:39:15

Quem nunca se perdeu enquanto navegava em um repositório no GitHub? Recentemente encontrei uma ferramenta que chamou bastante minha atenção e tem me ajudado diariamente a não me perder nos meus códigos antigos.
<hr>

## GitHub1s
O projeto basicamente apresenta uma forma fácil de acessar e visualizar seu repositório do Github como se estivesse dentro do editor Visual Studio Code. Para isso basta adicionar '1s' após 'github' na url do repositório e pressionar enter, como no exemplo:

![GitHub1s - Usage](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/vs-code-github1s.png)
<br>

### Demo
![GitHub1s - Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxlsocg2kelwvlfc3eu1.png)
<br>

### Desenvolvimento em nuvem
Além de poder visualizar todo seu projeto também é possível editar arquivos, executar containers do docker e criar pull requests através da integração com o [GitPod](https://www.gitpod.io), para isso basta clicar no botão "Develop your project on Gitpod" na barra de status.

![Gitpod Status Bar](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/gitpod-statusbar.png)

Também é possível utilizar a ferramenta para desenvolvimento local, para isso basta dar uma olhada na documentação [clicando aqui.](https://github.com/conwnet/github1s#readme)
<br>

### Extensões
Para facilitar ainda mais é possível adicionar extensões criadas pela comunidade para acessar de forma mais rápida a ferramenta:

![Extensions](https://camo.githubusercontent.com/70b5b3d373db4e1b55f8ed2981932a9f652b90ec8ed2179d2194a13f66d86d90/68747470733a2f2f692e696d6775722e636f6d2f4e584e547a37502e706e67)

Confira a lista de extensões [aqui!](https://github.com/conwnet/github1s#third-party-related-projects) E escolha a que mais te agrada.

<hr>

Esta dica foi útil? Comente se te ajudou e compartilhe!