teleren/devto huggingface dataset:
Gitui is a blazing fast terminal git interface
Tags: git
Published: 2021-01-17 16:45:34

---
canonical_url: https://waylonwalker.com/gitui
cover: /static/gitui-xmas2020.png
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/n51cifdf00x0bam1gegd.png
status: published
published: true
tags:
- git
templateKey: blog-post
title: Gitui is a blazing fast terminal git interface
---

Gitui is a terminal-based git user interface (TUI) that will change the way that you work with git. I have been a long-time user of the git cli, and it's been hard to beat, mostly because there is nothing that keeps my fingers on the keyboard quite like it, except `gitui` which comes with some great ways to very
quickly walk through a git project.


## installation

Go to their [releases]https://github.com/extrawurst/gitui/releases) page,
download the latest build, and pop it on your PATH.  I have the following stuffed away in some install scripts to get the latest version.


_<small>install latest release</small>_
``` bash
GITUI_VERSION=$(curl --silent https://github.com/extrawurst/gitui/releases/latest | tr -d '"' | sed 's/^.*tag\///g' | sed 's/>.*$//g' | sed 's/^v//')
wget https://github.com/extrawurst/gitui/releases/download/v${GITUI_VERSION}/gitui-linux-musl.tar.gz -O- -q | sudo tar -zxf - -C /usr/bin/
```

## run `gitui`

It opens blazing fast.

``` bash
gitui
```

## Quick Commits

Sometimes I edit a number of files and want to commit them one at a time, this is painful in the git cli and my main use case for `gitui`.  `gitui` shows unstaged changes at the top, staged changes on the bottom, and a diff on the right.


![gitui status](https://waylonwalker.com/gitui-status.png)


## Navigate with hjkl

By default, `gitui` uses arrow keys, but simply copying [vim_style_key_config.ron](https://github.com/extrawurst/gitui/blob/master/assets/vim_style_key_config.ron) to your config directory will get you vim-like keybindings.

## workflow

Generally, I pop open `gitui`, use j/k to get to the file I want to commit, glance at the diff to the right, press enter to stage the file, sc to switch focus to the saged files and commit, write my commit message hit enter and done.

* w/s:   to toggle focus between working and staged changes
* j/k:   to scroll each section
* h/l:   switch between left and right side
* enter: toggle file from working or staging
* c:     start a commit message
* p:     push
* <c-c>: quit

## Other Panes

I am in the `Status [1]` pane 90% of the time, but it also has three other panes for `Log [2]`, `Stashing [3]`, and `Stashes [4]`.  I do not really use the stashes panes, but the `Log [2]` pane is quite useful to quickly go through the last set of commits and see the diff for each of them.

## What UI do you use for git

Let me know what ui you use for git, do you stick to the cli, use a gui, or use a similar `TUI` interface?
Bracket Pair Colorizer 2 - VS Code Extension Highlight
Tags: webdev, productivity, vscode
Published: 2021-01-17 16:24:57

---
title: Bracket Pair Colorizer 2 - VS Code Extension Highlight
published: true
description: Bracket Pair Colorizer 2 is a great Visual Studio Code extension if your using a language that utilizes parenthesis or brackets. It allows matching brackets & parenthesis to be identified with colors and adds some other UI sugar to make it easy to identify what scope you're typing in. In this video we discuss the features and some customization options available.
tags: webdev, productivity, vscode
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/djzwhjuy01zgt7f9c565.png
---

{% youtube p24vnBYWSQQ %}

Bracket Pair Colorizer 2 is a great Visual Studio Code extension if your using a language that utilizes parenthesis or brackets. It allows matching brackets & parenthesis to be identified with colors and adds some other UI sugar to make it easy to identify what scope you're typing in. In this video we discuss the features and some customization options available.
Logging
Published: 2021-01-17 16:23:31

Hey Guys! Hope everyone is good out there and doing well in all what you all can do :)
Recently, I was revising the Exception-Handling concept in Python. I came through a topic called "logging".
Since now I've had quite a fine time with Python, I still could not figure out what's the exact use of learning logging concept for a student. I haven't come across any scenarios where I would be using the logging concept.
It would really be helpful if you guys could help me out.
Looking forward to the answers you guys!!
Thanks a lot in advance ;)
Best .NET Posts This Week: 17th January 2021
Tags: dotnet, dotnetcore, csharp, aspnetcore
Published: 2021-01-17 16:14:35

---
title: Best .NET Posts This Week: 17th January 2021
published: true
description: Here are some of the best .NET, C# and ASP NET posts from this week
tags: dotnet,dotnetcore,csharp,aspnetcore
cover_image: https://cdn.hashnode.com/res/hashnode/image/upload/v1610899909195/cxU1EN227.png
canonical_url: https://samwalpole.com/best-net-posts-this-week-17th-january-2021
---

Here are some of the best .NET, C# and ASP NET posts from this week.

# This Weeks Articles
## [My preferred .NET console stack](https://www.devlead.se/posts/2021/2021-01-15-my-preferred-console-stack)
By Mattias Karlsson
> An opinionated view on the boilerplate starting point of any .NET console application

## [A Practical Intro to Covariance and Contravariance in C#](https://vkontech.com/a-practical-intro-to-covariance-and-contravariance-in-c/)
By Vasil Kosturski
> When defining a generic interface, have you received a hint from Resharper like “The type parameter T could be declared as covariant” (or “contravariant”)? If so, have you then blindly applied the proposed refactoring which decorates your generic parameter with the in or out keyword? I know I’ve done this a few times before deciding to dig deeper into what these terms actually mean and how they affect my type’s behavior. Type variance is one of the topics developers work with pretty much on a daily basis but don’t always understand it well.

## [Introduction to Test Driven Development (TDD) and AAA Testing using xUnit](https://samwalpole.com/introduction-to-test-driven-development-tdd-and-aaa-testing-using-xunit)
By Sam Walpole
> I'm not ashamed to admit that for a long time I avoided writing tests for my code. I saw it as something that took up precious time that I could have spent on "real" coding. However, after experiencing first-hand the headache caused from having to maintain production code with little-to-no tests, I've been convinced that writing tests really are worth your time. Too many times have I been bitten by hidden bugs, that could have easily been identified if the appropriate tests were in place.

# You Might Also Like
- [Writing decoupled code with MediatR: The Mediator Pattern](https://samwalpole.com/writing-decoupled-code-with-mediatr-the-mediator-pattern)
- [Learn to make a web app with ASP NET Core and Vue](https://samwalpole.com/learn-to-make-a-web-app-with-asp-net-core-and-vue)

["Ten++ Ways to Make Money as a Developer" eBook](https://gumroad.com/a/633205875)

I post mostly about full stack .NET and Vue web development. To make sure that you don't miss out on any posts, please follow this blog and [subscribe to my newsletter](https://samwalpole.com). If you found this post helpful, please like it and share it. You can also find me on [Twitter](https://twitter.com/dr_sam_walpole).
Default Javascript Array Sorting
Tags: javascript, array, sorting
Published: 2021-01-17 16:04:44

---
title: Default Javascript Array Sorting
published: true
// description: Abc
tags: javascript, array, sorting
// cover_image: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3cp1rdmt0pgdhc22h2dk.jpg)
---

I was recently solving a simple [programming problem](https://codeforces.com/contest/1473/problem/A) with TS, where I had to sort an array of integers in ascending order as part of the solution. So, naturally, I resorted to the `array.sort()` method.

To my surprise, I was getting a wrong answer verdict even though I was certain that my solution was correct. It turned out that TS (or rather JS) array default sorting behaviour has a quite confusing caveat.

To get a better understanding of what I am talking about, let's see the following code:

**Snippet 1:**
```
[10, 2, 1].sort()
```

**Snippet 2:**
```
['10', '2', '1'].sort()
```

In C++/C#/Java/C, the snippet 1 would return `[1, 2, 10]` and snippet 2 would return `['1', '10', '2']`.

However, in JS world, both of the snippets would return the same order (`[1, 10, 2]` and `['1', '10', '2']` respectively) because in JS the default behaviour is to convert the values into strings and then run sorting ([details](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#content:~:text=built%20upon%20converting%20the%20elements%20into,sequences%20of%20UTF%2D16%20code%20units%20values)).

For **Snippet 1** to work correctly in JS:
```
[10, 2, 1].sort((a, b) => a - b)
```

That's it for today!

PS. This is my first post in dev.to or in any platform
PSS. If you are interested to know about solving programming problems in TS feel free to check out my [repo](https://github.com/siamcr7/ts-node-problem-solving).
Staying Alive: The Screen Wake Lock API
Tags: html, javascript, css, api
Published: 2021-01-17 16:01:20

Friday night I was cooking a delicious vegetarian bolognese — but was annoyed that my iPhone kept dimming the screen, and soon after locking the screen. I know that I can change the "time-to-lock" (or whatever it's called!?) in Settings, but wouldn't it be smarter, if we could tell a webpage to "stay alive"?

The [Screen Wake Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API) does exactly that — but, at the moment, only in Chrome.

To test it, I used Chrome on my MacBook.

First, I set the `Turn display off after` to `1 min`:

![Battery Settings BigSur](https://dev-to-uploads.s3.amazonaws.com/i/nuafahpmbe72vpgaza2b.png)

Then I added a checkbox for turning on/off the Wake Lock API. The checkbox is hidden and it's label shown as an icon — the crossed-out, grey eye at the top right corner:

![screenWakeLockDisabled](https://dev-to-uploads.s3.amazonaws.com/i/a1vxk6obxbpraxp7wein.png)

Then, when pressed, the icon changes to an open, green eye:

![screenWakeLockEnabled](https://dev-to-uploads.s3.amazonaws.com/i/yo39rp7ugujc5n5ijqsj.png)

The JavaScript-code for toggling the `Screen Wake Lock` is pretty straight-forward:

```js
const wakeLockToggle = document.querySelector('[data-wake-lock] > input');
if (wakeLockToggle && ('wakeLock' in navigator)) {
  let wakeLock = null;
  const wakeLockEnable = async () => { 
    try {
      wakeLock = await navigator.wakeLock.request('screen');
    } catch (err) {
      console.error(`${err.name}, ${err.message}`);
    }
  }
  wakeLockToggle.addEventListener('click', () => {
    if (wakeLockToggle.checked) {
      wakeLockEnable();
    }
    else {
      wakeLock.release()
      .then(() => {
        wakeLock = null;
      });
    }
  })
}
``` 

Next, I left the MacBook open, touching nothing. 

As predicted, it dimmed the screen after one minute. Then I turned *on* the `Screen Wake Lock` — and after 3 minutes the screen hadn't dimmed. Hooray! 

---

## Demo

Unfortunately, Codepen prevents the `Screen Wake Lock API` from loading due to a feature policy, but I've uploaded a demo [here!](https://assets.stoumann.dk/recipe.html)

---

## Bonus: Structured Markup
Using Google's Rich Snippets is a SEO bonus, so I've added it to the demo-recipe. Using Google's [Rich Result Testing Tool](https://search.google.com/test/rich-results), you can preview what Google sees:

![Rich Snippet](https://dev-to-uploads.s3.amazonaws.com/i/zlw4fydhquo5esr0httb.png)

--

## Right-to-left

I used `CSS Logical Properties` for some of the styles, including `border-block-start-width`, `padding-inline-start` and `margin-block-end`. 

If you inspect the demo-markup, change `ltr` to `rtl` at the top of the document:

```html
<html lang="en-US" dir="ltr">
```

I can only encourage sites with recipes to embrace the `Screen Wake Lock API`!

Thanks for reading!
Learning React
Tags: react, javascript
Published: 2021-01-17 15:57:46

I have started learning React yesterday.
I have put into that like 10 hours, since yesterday morning, but I feel like, I have **ZERO** clue what is going on.

I would like to kindly ask you fellow developers, to send me sources where I can understand the basics of this library.
Brad Traversy's course was waaaaay to much and I had to leave the 2 hours video at the half of it, because there was too much going on.
I am now doing [Dev Ed's Todo list app](https://www.youtube.com/watch?v=pCA4qpQDZD8&t) but it's also too much and every one of these tutorials are too fast for a beginner like me.

I feel like I have kind of good understanding of Vanilla JS, but React is a totally different cup of tea.

Please help me :(

Thank you in advance!
Intents-Android
Tags: mlh, majorleaguehacking, localhackday
Published: 2021-01-17 15:43:38

What is Intent in Android?

In Android, it is quite usual for users to witness a jump from one application to another as a part of the whole process, for example, searching for a location on the browser and witnessing a direct jump into Google Maps or receiving payment links in Messages Application (SMS) and on clicking jumping to PayPal or GPay (Google Pay). This process of taking users from one application to another is achieved by passing the Intent to the system.

Intents could be Implicit, for instance, calling intended actions and explicit as well, such as opening another activity after some operations like onClick or anything else.

Android intents are mainly used to:

Start the service
Launch an activity
Display a web page
Display a list of contacts
Broadcast a message
Dial a phone call etc.


Types of Android Intents
There are two types of intents in android: 

Implicit and
Explicit.
1. Implicit Intent

Implicit Intent doesn’t specify the component.In such case, intent provides information of available components provided by the system that is to be invoked.

For example, you may write code to view the webpage.

2. Explicit Intent

Explicit Intent specifies the component. In such a case, intent provides the external class to be invoked.
A Regular Expression to filter invalid names | Notes
Tags: notes, regex, recipe
Published: 2021-01-20 09:04:12

---
title: A Regular Expression to filter invalid names | Notes
published: true
date: 2021-01-17 15:38:00 UTC
tags: notes,regex,recipe
canonical_url: https://abhi.page/notes/regex-to-validate-names/
---

A regular expression that can be used as a basic filter to detect invalid names.

- I use it in an Indian context. May not be useful for others.
- Use it with an ‘i’ RegEx flag to ignore case.
- Filters out spelling mistakes & gibberish entries; _but not all invalid entries!_
- Similarly useful for other English nouns as well, and not just names.
- Useful for quick frontend validation in scenarios where users may tap gibberish to quickly skip a mandatory ‘name’ parameter.

```regex
^(?!(?:(?:([a-z]) *\1(?: *\1)*)|(?:.*?(?:(?:(?:^|[^d])([a-z])\2\2)|(?:d([a-df-z])\3\3)).*)|(?:.*?([a-z]{3,})\4\4).*|(?:.*(?:^|[^a-z])[^aeiou \.]{4,}(?:$|[^a-z]).*))$)(?:[a-z]+\.? ){0,2}[a-z]+$
```

### Logic [§](https://abhi.page/notes/regex-to-validate-names/#logic)

1. Allows up to three words (first & last name).
2. Allows abbreviations (ending in ‘.’) in all but the last word.
3. Rejects repetition of any subset of characters.
4. Uses rules of pronounceable English syllables to filter bad entries _(based on my limited research)_:
  1. A consonant cannot be consecutively repeated.
  2. A vowel cannot be consecutively repeated more than twice.
    1. Exception: _e_ that can be repeated thrice for certain Indian names, for example, those ending with ‘deee’.
5. … _(more to be updated soon)_

_ **Note:** _  
I had written this long back by analyzing invalid entries made in a fin-tech app used by agents to make entries on behalf of other customers. I will update the exact logic and describe parts of the regex soon!

Test it here & get a sample code in Javascript:

<iframe height="220" style="width:100%;" scrolling="no" title="See the Pen" src="https://codepen.io/anon/embed/wvzNaQM?height=220&amp;theme-id=dark&amp;default-tab=result" frameborder="0" loading="lazy" allowtransparency="true" allowfullscreen="true"><p><a href="https://codepen.io/abhiweb/pen/wvzNaQM" target="_blank" rel="noopener">See the Pen</a></p></iframe>
* * *

[**Read on abhi.page**](https://abhi.page/notes/regex-to-validate-names/)
Few common things about DOMAIN
Published: 2021-01-17 15:32:15

A domain name is a identification unique address denoted by the user. Domain name are usually use for visiting in different address. In general a domain name identifies a network domain which represents to Internet protocol (IP) resource, means a personal computer can used to access the Internet, a server computer hosting website,   or any other service communicated via the Internet. 

Different domains are :symbolics.com, bbn.com, think.com, mcc.com, dec.com, northrop.com, xerox.com,  sri.com, hp.com , bellcore.com , ibm.com , sun.com, intel.com , ti.com, att.com , gmr.com , tek.com , fmc.com , ub.com ,bell-atl.com etc.
The Top Level Domain (TLDs) are com, net and org for the Internet
The domain name is a component for Uniform Recourse locator (URL) used to access through Internet for example: URL: http://www.example.net/index.html, Top-level domain: net, Second-level domain, Hostname: www.
4 types of technical interviews to hire developers
Tags: hiredevelopers
Published: 2021-01-17 15:29:10

---
title: 4 types of technical  interviews to hire developers
published: true
description: 
tags: hiredevelopers
//cover_image: https://direct_url_to_image.jpg
---

Software companies are constantly finding the best way to evaluate developers, and despite every company has a different process we can find these commons ways to do it:

#### Video interviews

In this kind of interviews, you can ask theoretical questions to the developer about a specific programming language or technology, for example: 

* Can you describe and explain the lifecycle of React?
* What is the difference between false and nil in Ruby?

As you can see, these questions don't need the candidate to write code, just answer the question in a verbal way.



#### Case interviews

You can use this kind of interview to show a real scenario to the candidate, and ask questions about how to solve specific problems of that application.

For example, if you are testing a front-end developer, you can ask him about how to code in CSS and JS a complex menu.


#### Coding interviews (to make at home)

As you can see in the title, these kinds of projects are about challenging the programmer to make little projects that can be completed in 2 days or less. After that, developers need to send you a repository with code to later be analyzed with someone in the team.

#### Whiteboard interviews

In these interviews, you can invite developers to the offices, and in a blackboard, ask them to solve an algorithm or problem. The objective is to check how he can solve it. Nowadays you can use a platform for real-time coding.

A disadvantage is some developers can get nervous and not solve the problem correctly.

Let me know what other types of interviews you know or implement your company to [hire software developers](https://www.sundevs.com/staff-augmentation).
Project0 #2 - Grow to Full Height Using Flexbox
Tags: webdev, cs50, html, css
Published: 2021-01-17 15:27:07

### Full Height Grow Explanation
From previous post of this series, I was looking for a way to grow the content to full height without having to perform any calculation of subtracting the height of the other elements.

The cover image shows one method of doing it by using flexbox, specifically the `flex-grow` attribute. 
* The header section represents any top navigation bar or title
* The content section represents the area that we wish to grow to the remaining height of body.
* The footer section represents... the footer 😜

Feel free to playaround with the example in the code snippet below:

{% replit @wizlee/FullHeightGrow %}

---

### Project0 Progress
The main search page is done! 🎉 Now left the image and the advanced search pages. Prior to doing this exercise I will be underestimating the work needed to exactly replicate google search main page, but after this exercise I have more appreciation for the work needed. 

Even though the web development work so far are very basic, I am satisfied with what I have learnt and done. The GIF below shows the actual google search page VS what I had done =)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8820jd6qmd5blbsykjhq.gif)
How to hire Ruby on Rails developers (12 questions for a job interview)
Tags: hiredevelopers
Published: 2021-01-17 15:25:38

---
title: How to hire Ruby on Rails developers (12 questions for a job interview)
published: true
description: 
tags: hiredevelopers
//cover_image: https://direct_url_to_image.jpg
---

In another post, I was documenting some of the interview questions that I think are important to us when we are trying to [hire iOS developers](https://dev.to/sundevs/how-to-hire-ios-developers-9-questions-for-a-job-interview-2jj2). In this case, I'm going to expose some questions for an interview for Ruby on Rails developers.

#### Ruby language

1. What is the difference between a class and a module?
2. What are the three levels of method access control for classes and what do they mean?
3. What does "self" mean?
4. Explain what singleton methods are. What is Eigenclass in Ruby?
5. What is the difference between false and nil in Ruby?

#### Rails Framework

6. What is the Asset Pipeline?
7. Explain the "Active record" pattern.
8. What is a  Polymorphic Association in Rails?
9. Explain the difference between optimistic and pessimistic locking in Rails.

#### Security

10. What is the CSRF? How do Rails protect an application against this security flaw?
11. How should we store insecure data such as passwords?
12. Why do we need to use HTTPS instead of HTTP?

Let me know what other questions you would use for an interview to [hire Ruby on Rails developers](https://www.sundevs.com/staff-augmentation).
My Local Hack Day - BUILD 2021 Experience | Major Hacking League | Guild: Devscript Winter Of Code
Tags: localhackday, mlh, majorleaguehacking, hack
Published: 2021-01-17 15:06:48

Hey everyone! Here I am attending another awesome event organized by the Major League Hacking Community.

It was a lovely experience, full of energy! We(I along with my guild mates) came together every day and completed these super creative, crazy tasks and try to finish all of the challenges in the amount of time allotted.

I had a lot of fun attending the live streams with Ryan, Mary, Sashrika, Jack and other coaches of MLH. I really like how they guide us in every challenge they give as well as entertain us throughout the week of LHD. Every day I get to know some new skills and technologies and it really helps me build my profile.

My guild always bagged the 5th position among other 100 guilds of MLH! I was among the top 4% of the high scorers among 3000 hackers! Every day, our scores would shoot up in a huge number and it was a sight to see when everybody used to come together on the live stream to see the leaderboard updates along with TNR(if you know, you know)! Had a lot of fun working with this amazing team. 

All thanks to Major Hacking League for organizing such a fantastic event and Devscript Winter Of Code for letting me be a member and adding a little something from my part to this community! I hacked for 7 days straight and learnt a lot of new things. The event was very impactful, totally loved the challenges and not to forget the amazing stickers that each person will be rewarded with!