teleren/devto huggingface dataset:
Git Tags: What are they and How to use them
Tags: git, codenewbie, beginners
Published: 2020-02-29 17:42:37

---
title: Git Tags: What are they and How to use them
cover_image: https://res.cloudinary.com/dis3a42lz/image/upload/v1582997145/blog/git%20tags/cover-image.png 
published: true
description: 
tags: #git #code-newbie #beginner
---

Git Tags are references to a specific point in a repository's history, they are pointers to commits and are mostly used to mark release points i.e v0.0.1. Tags are different from branches because unlike branches after they are created commits can't be added to them.

## Creating a Tag
There are two types of tags supported by git (Lightweight Tags and Annotated Tags)

**Annotated Tags:** are tags that store information relating to the tag such as the description, tagger, and date. To create an annotated tag we use the -a flag. The -m flag is also used to provide a custom message, if it isn't provided git launches your editor.
```
git tag -a v0.0.1 -m "An annotated Tag"
```
To  see the information of an annotated tag run:
```
git cat-file tag v0.0.1
```
![enter image description here](https://res.cloudinary.com/dis3a42lz/image/upload/v1582996216/blog/git%20tags/tag2.png)

**Lightweight Tags:** are just pointers to a specific commit history and they don't provide any extra information relating to the tag.
```
git tag v0.0.2
```

## Creating a Tag from a commit 
By default, tags are created from the most recent commit. If you want to tag an older commit then run
```
git tag v0.0.3 <commit-id>
```

## Listing Tags
To list the tags in your repository run ``git tag`` this list tags in alphabetical order

## Searching For Tags
In a case where the tags are much and you are looking for a specific tag, you can add the -l flag to search for the specific tag needed
```
git tag -l v0.0.2
```

## Pushing Tags to a Repository
A tag isn't pushed to a repository when you run `git push`. To push a tag to a repository you have to run
```
git push origin <tag-name>
```

## Checkout a Tag
You can checkout a tag by running `git checkout <tag-name>` however this only allows you to view the  state of the repository as of when the tag was created, to be able to make changes you have to create a branch from the existing tag by running
```
git checkout -b <new-branch> <tag-name>
```

## Delete a Tag
To delete a tag on your local repository you can simply run
```
git tag -d v0.0.1
```
however, if the tag exists on your remote server you will have to run this command
```
git push origin --delete v0.0.1
```

In conclusion, you should use a tag to create a new release rather than branches and you can always create a branch off a tag to create patches to a release version.
QA de ofertas de empleo
Tags: python, opensource, qa, trabajo
Published: 2020-02-29 17:30:42

Últimamente las ofertas de trabajo son bastante vacías. Se dan situaciones absurdas como no saber para qué cliente vas a trabajar o cuántos días de vacaciones vas a recibir. ¿Merece la pena una oferta de la compañía de mis sueños si no sé qué quieren para su proyecto?

Viendo desde el punto de vista del empleador, ¿por qué nadie me responde a mis ofertas de trabajo? Si soy de una empresa de selección de personal, ¿cómo le hago entender a mi cliente que ha de darme más detalles?

Por ello necesitamos una manera de hacer ver a los demás desde un punto de vista matemático si una oferta es buena. Para ello desarrollé el proyecto [qa-empleo](https://github.com/RafaelAybar/qa-empleo)


Aunque todos los criterios son subjetivos por que no todo el mundo busca el mismo tipo de trabajo, con qa-empleo quiero crear una forma de poder evitar que por ejemplo, por querer trabajar en una compañía famosa acabemos frustrados por no tener en cuenta aspectos como el teletrabajo o que el proyecto no es lo parecía

El proyecto está muy muy verde,me falta calcular la rotación histórica (ratio de trabajadores que abandonan la compañía) a través de la api de LinkedIn. 

El proyecto en sí no es más que un script que se ejecuta de la siguiente forma:

```python3 qa-empleo.py nombre-de-la-empresa nota-tipo-contrato nota-ubicación-cliente nota-requerimientos-cliente nota-vacaciones nota-salario nota-horario nota-teletrabajo```

El script mostrará por pantalla la rotación histórica del proyecto y si la oferta es buena (la nota ha de ser superior a 6)

Si os gusta la idea cualquier sugerencia es bienvenida, bien por aquí, bien mediante un issue en el repositorio del proyecto.
Show dev.to: an A/B test checker
Tags: webdev, javascript, showdev
Published: 2020-02-29 17:15:07

Hi everyone, 

Too many times I saw people on Facebook happy that their conversion increased from 1.1% to 2% with less than 500 visits, the truth is, there is no way to be sure that their conversion actually changed with only 500 visits and such a low conversion rate.

This is because of something called the "p-value". In short, the "p-value" is a Mathematical value that measures how statistically significant is a hypothesis. 


In our case, the hypothesis could be: A is performing better than B in our A/B test or, this ad on Facebook is converting more.

This is, of course, an oversimplification, but in short, the p-value can tell you if you can draw a conclusion with your results or if you should wait to have a bigger sample.

I've made this [small tool](https://www.abtestchecker.com/) to help you draw a conclusion from your A/B tests that I hope you will like and find interesting. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1mw8l84tfrfd8rzcbaf6.png)

This thing took me quite a bit of time to code, so if you think twitter would like it, do not hesitate to share it, it helps a lot 🙏😉

{% twitter 1233802055720087552 %}

(but do NOT create an account just for this though)

If you want to read more about it you can this [excellent post](https://www.freecodecamp.org/news/what-is-statistical-significance-p-value-defined-and-how-to-calculate-it/) on FCC.com.

Do not hesitate to [follow me](https://twitter.com/PierreDeWulf) if you don't want to miss my next posts. I write about tech, my bootstrapping journey and I occasionally write more data analysis articles.
Into the Flywheel
Tags: writing, learninpublic
Published: 2020-02-29 17:08:27

[Bill James](https://en.wikipedia.org/wiki/Bill_James) is likely a name you've never heard before. Back in the 1970s no one had heard his name before. Yet today he is considered one of the fathers of modern baseball statistics. How did he go from being a no-name baseball enthusiast to someone who has had a considerable influence on the entire sport?

Bill James was fascinated by baseball statistics that seemingly no one else was talking about. He went beyond tracking these statistics to writing and publishing a series of books. These books were filled with statistics and his own analysis of them. A few people started purchasing these books. He had found a niche, really an ultra-niche. He let his passion carry him and he continued publishing. His audience grew and soon he was part of a broader conversation about baseball.

> Write for yourself, and you’ll write for the close friends you didn’t know you had.

He went from outsider to insider. He had created for himself a flywheel. A virtuous cycle of ideas and interesting conversation with interesting people.

> write about what you’re interested in, meet people you’d find interesting, discover your next topic, continue. The end result is that you subject your intellectual development to a sort of intelligent design instead of random evolution: you’ll tend to go where the next insights are.

Forget what everyone else is talking about. Find the thing that really catches your interest. Start pursuing it. Write about it. Put yourself out there and see who gets drawn in. The conversation you're starting will create an ultra-niche. Maybe it will stay small, maybe it will grow. Either way, you'll be in the middle of what interests you most. You'll gain insights, find new interests, and [catch friends](https://www.swyx.io/writing/friendcatchers/).

---

References:

- [The 'Marker' Guide to Content Marketing for Non-Hucksters](https://marker.medium.com/the-marker-guide-to-content-marketing-for-non-hucksters-e0572916e217), Byrne Hobart
- [Friendcatchers](https://www.swyx.io/writing/friendcatchers/), Shawn Wang

Notes:

I first heard about Bill James in the book [Moneyball by Michael Lewis](https://en.wikipedia.org/wiki/Moneyball). It provides a fun peek into the world of baseball. Give it a read.
I got my first job! (As a Junior Front End Developer)
Tags: beginners, career
Published: 2020-02-18 06:18:12

Hey all! It's been a long time since i wrote here. I was working on to get a Junior Front End Developer job and it went well. I got it.

It got 3 interviews to take it. The first interview was with Human Resources Department and at the same day i gave the the technical interview too. After one week they invited me for another meeting. It was an interview both about company policy and a little bit more technical knowledge.

##What i did to get this job?

I made sure that i have a good, clean and creative **resume**. <br>
Made my website to show some of my skills(Also it is deeply needed just because you are a developer. More than showing off your skills i see a personal website as a digital ID we own.). <br>
Filled my [codepen](https://codepen.io/batuhangulgor) by challenging myself with [100 Days CSS Challenge](https://100dayscss.com/). <br> 
Tried to expand my network in [LinkedIn](https://www.linkedin.com/in/batuhangulgor/). <br>  
Read many articles in dev.to (and still reading) to get a little bit more understanding of what i am trying to learn. Thanks to community there are so many articles to read <3.

##What courses did i take?

1) [Build Responsive Real World Websites with HTML5 and CSS3](https://www.udemy.com/course/design-and-develop-a-killer-website-with-html5-and-css3/) <br> 

2) [Web Design for Web Developers: Build Beautiful Websites!](https://www.udemy.com/course/web-design-secrets/) <br> 

3) [Advanced CSS and Sass: Flexbox, Grid, Animations and More!](https://www.udemy.com/course/advanced-css-and-sass/) <br> 

4) [The Complete JavaScript Course 2020: Build Real Projects!](https://www.udemy.com/course/the-complete-javascript-course/)

**This man is a life saver, for real. If you want to be a Front End Developer and start somewhere this can be your walkthrough.**

**If you struggle to start, just go for it. Buy these courses and once you start to watch, you will see in a lesson or two you are going to love it.**
Trying an new framework without internet
Tags: angular, codenewbie, onseui, offline
Published: 2020-02-29 16:29:51

# What?
I'm a backend developer and I'm working on a new personal project, the rest API is almost done and I thought "It's time to make my app". As it is one of my dreams, I concluded "Do it all by myself", but, I just know a little bit of Angular and just it, meanwhile, I started my search for an cool framework that even working with angular would look as mobile app.

When my hopes was already lost, I found the incredible, [Onsen Ui](https://onsen.io/) an beautiful "way" to achieve my goal.
I found it just in the night before an three-day weekend in my country, that i would travel to my country house, where, we don't have internet or mobile signal, it's just the place to 'recharge the battery".

# How?
As I would be offline for some days, I started the preparation, that is, downloading all sample and documentation (that don't have pdf avalaible, i was forced to download pages from their website) that was possible and obviously, run npm install on my starter project.

Then it began... I noticed that their tutorial is really simple and started to make some fields and the tabs, but, the problem started when I was trying to consume my local api. 

CORS... I was intrigued, because, on the response header the cors header was present and I faced the problem that is __we are Google and Stack Overflow addicted__ there was no one that could help me offline. Tried for hours to change the way that I was including my cors header on api. Finally I got my mistake.

I was passing the wrong url and the browser just saying that was Cors error, but actually was an "you are dumb" error. Fixed that and my journey continued, until the first epic was complete.

# What I Learned?

I faced a lot of errors (the saddest one was the "cors" that was not cors) and managed to fix them without help, then I realized that this is the real way to learn, If I was on internet, would took some hours to make what I spent 2 days to do, but, if I tried this again in one or two weeks, I would re-spend this time, because wouldn't be me resolving problems, would be the internet.

The point is, we are starting to loose control about what we need to search and what we can think about to solve. If you, reading that, really want to know some new tech, download the docs, set an goal and go offline.


Thanks for reading!
Make VSCode works with your custom Webpack aliases
Tags: vscode, webpack, eslint, productivity
Published: 2020-02-29 16:24:01

Here is a project folder tree, I just a guy contribute on it, can't change the structure. I love VSCode so much, but it seems never got the same level on the professional like WebStorm does. But I usually try to get things done on my favorite editor instead changing to the new IDE.
 
```
.
|__app/
|__internals/
|  |__webpack/
|     |__webpack.dev.config.js (by env)
|     |__webpack.prod.config.js (by env)
|     |__webpack.base.config.js (main config is in here)
|
|__webpack.config.js (proxys to internal/webpack/webpack.[env].config.js)
 
```
You can imaging it has a link here:
```
>> webpack.config.js 
- require webpack.dev.config.js
>> webpack.dev.config.js 
- loads webpack.base.config.js
- webpack.dev.config.js has it own configurations
```


**Problem**: The ESLint config use "webpack" for "import/resolver", but my VSCode cannot detect it. In this case, the aliases are `@app` and `@internals`, they should indicate for `./app` and `./internal` when I use import statement. And auto complete should works.

I just found some ways to deal with this problem. I really appreciate their answers, good people on the internet.


## Option 1: 

From this answer: https://medium.com/@justintulk/solve-module-import-aliasing-for-webpack-jest-and-vscode-74007ce4adc9#9b0b

Use `jsconfig.json` as a way to communicate to VSCode officially. Read more here: https://code.visualstudio.com/docs/languages/jsconfig (I even didn't read it).

### I've done with this one:

1. Create `jsconfig.json` on root folder.
2. Add below content into file.

```
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@app/*": ["app/*"],
      "@internals/": ["internals/"]
    }
  },
  "exclude": ["dist", "some_dirs_dont_have_code"]
}
```

## Option 2: 

From this answer: https://stackoverflow.com/a/54939613/1155318

Use **Path Intellisense** extension, make your own workspace config work with extension: https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense

![How Path Intellisense works](http://i.giphy.com/iaHeUiDeTUZuo.gif)

### I've done with this one:

1. Install the extension.
2. Add this one to Workspace setting.

```
{
  "path-intellisense.mappings": {
    "@app": "${workspaceRoot}/app"
    "@internals": "${workspaceRoot}/internals"
  }
}
```

## Difference

#### Option 1
- Folder suggestion by auto-complete works well.
- You can click on imported path to go to destination file.

#### Option 2
- Folder suggestion by auto-complete works well
- It does not have a link to destination file, then you can't click on imported path.
- But this extension can help you in many cases, not only on import statement of `.js` files.

## Finally

I don't have the conclusion, but I used **Option 1** and still install **Path Intellisense** for other purposes. Hope anyone has the same problem can get it done by this synthesis post.
Passing Functions as Arguments in Ruby
Tags: ruby, newbie
Published: 2020-02-13 22:27:30

---
title: Passing Functions as Arguments in Ruby
published: true
description: turns out, that's a thing you can do
tags: #ruby #newbie
---

It can be done! As per my last blog post, with no further ado, here is how you do it:  

```ruby
def first_option
    puts "space jam"
end

def second_option
    puts "dogs rule"
end

def receives_function(func)
   method(func).call
end

receives_function(:first_option)
```
It is **imperative** to notice that you must pass the function through as a symbol when you are ready to send it along. 

There are a few things about this setup that you may find interesting. When I first started looking into this, I assumed that you could just pass them through normally, using `receives_function(first_option)`. I figured, Ruby is nice right? 

Wrong. 

Just kidding, I mean Ruby is nice, but it's not magic. Because Ruby is a synchronous language and function calls only require the name of the function, Ruby will read `receives_function(first_option)` and *immediately* invoke the **first_option** method, before it enters **receives_function** method at all.

So let's dive into the other stuff. The symbol terminology is Ruby's built-in way to allow you to reference a function without calling it. By placing the symbol in the argument for **receives_function**, we are able to pass all the info along and actually get into the **receives_function** code block before executing anything. 

The next step is to figure out how to call a function which has been sent as a symbol. It gets a little hairy here because once we are inside of the **receives_function** code block, all we have to work with is a variable called *func*. Not a symbol at all. This is where Ruby's **method** method comes into play. 

As a side note, googling "Ruby method method" is marginally annoying, so [here](https://ruby-doc.org/core-2.6/Object.html#method-i-method) is the link to the Ruby Docs to save you the time if you're interested.

The **method** method takes an argument of a symbol and returns information about that symbol. When you pass it a symbol of another method, it will return something like this:

```ruby
[5] pry(main)> method(func)
=> #<Method: main.first_option>
```

With this it's saying hey, you passed me a method, and its name is first_option. You can chain a few commands on the end of this return value to determine other information about the symbol. For example, you could add `.source_location` and it would give you the file name and the line on which the original **first_option** function was defined. That's very useful for debugging, but in our case we don't care about that -- we just wanna invoke it. So, as you saw in the example, we chain a `.call` on there and "call" it a day. 

Sigh.

So that's that! Have fun out there.
Rails 6 and ngrok
Tags: rails, ngrok, ruby
Published: 2020-02-29 15:18:15

Long time lurker, first time caller.

I just recently updated my failed payment application to Rails 6.  Went to use Ngrok to test some webhoooks and got an interesting little error.  Now, unless you specify a host in rails 6 everything except for localhost gets blocked.  Great new security feature.  Buuuut, what if I use ngrok regularly and don't have the paid version so I get a new address every time I run it? It's regex to the rescue.

Simply open `config/environments/development.rb` and then add `config.hosts << /[a-z0-9]+\.ngrok\.io/`super simple and awesome.

Thought I'd keep it short.

Have an awesome week.
Why you shouldn`t use axios interceptors with Redux
Tags: react, redux, javascript
Published: 2020-02-29 15:18:10

Hi folks. This is my first post here! I hope you will enjoy my thoughts of software best practices 😊


##What are the axios interceptors? 

They are like simple middlewares which executes some logic before request and after responses. Interceptors are mostly used in authetication logic when we can attach some headers to every request. 


```javascript
axiosInstance.interceptors.request.use(
  config => {
    config.headers.authorization = store.get("authToken");
    return config;
  },
  error => Promise.reject(error)
);
```


In react projects I often see that programmers couple redux actions with axios interceptors, so for example action loginUser can update state of store and assign authorization token to request interceptor, and on logoutUser can remove token from store and also from axios interceptors. Sounds fine? Then I will explain why not.

At first, they coupled axios and redux. Ok, but… why redux should know details about http client? And what if you want to change http client that not support interceptors? OR what if you want to use the same axios to request to another source? Do you really want to expose your auth headers? 🤔

##Ok ok, you MAYBE have right… but what’s a good way to do it?

My propose to deal with it, is a magic thing called HoC. HoC is a good way to decouple your main logic from implementation details. 

Your HoC can have redux state with some auth token. HoCcan dynamically set header for every request in your API Client/DataProvider without using interceptors, and then just pass your DataProvider to wrapped component, so your component can be now well tested with mocked DataProvider and without knowing anything about interceptors implementation.

The best source of HoC and example of data provider is in the official react docs https://en.reactjs.org/docs/higher-order-components.html but you can create something similar in almost every framework

### What are your thoughts about interceptors with redux? I'd love to hear it!