teleren/devto huggingface dataset:
My open source technical writing portfolio
Tags: techwriting, opensource, portfolio
Published: 2019-05-02 16:50:45

---
title: My open source technical writing portfolio
published: true
description: 
tags: techwriting, opensource, portfolio
---

I published a video about my technical writing portfolio! In this video, I talk about how my publicly accessible GitHub profile serves as my technical writing portfolio and helps me demonstrate my tech writing skills, my collaborative skills, and my flexibility and proficiency with tech writing tools. Check it out!

{% youtube 68ddwfpXHrE %}
This Week In Work #2
Tags: review, weeklyreview, weeklyretro
Published: 2019-05-02 16:48:52

---
title: This Week In Work #2
series: This Week In Work
published: true
description: 
tags: review, weeklyreview, weeklyretro
---

Publishing my first weekly review gave me such a great feeling that I'm doing it again!

{% link seawolf/this-week-in-work-1-1po %}

Although it's been short, it's been good; here's what I've been paid to do this week.


### Leading Projects!

We're starting a project with our biggest client, and for the first time since becoming a senior developer, I've been the opportunity to lead our part! It's been great so far!

I've made sure that we have made as much documentation as possible, and that it is as useful as possible. This means clearly explaining the _why_ as well as the _what_, starting high-level before exploring the details, and making sure to identify the relationships between things as we build up the picture.

##### Conclusion

Start as we mean to go on, and keep going! You're not really doing the design and documentation for you, it's for your team, present, and future.


### Exploring Dark Corners

... of our technology stack!

I think this can be summarised with one fact:

> The documentation doesn't go as far back as the (pre-1.0) version we're using.

I've needed to add a few things to an existing application, but also implement a whole new process. This means understanding where and what the moving parts are, so I can find out how to create my stuff correctly. There's probably one person I can ask for help, but it is, unsurprisingly, years since they been have actively involved with the code that they would also have to search for documentation and examples.

It's been fun to dive into a framework, not so fun having to guess what is the correct way to do it!

##### Conclusion

Maintainability is a key part of software development, and tackling technical debt always pays off. Sometimes it's tough to take the big hits, like major version upgrades, re-writes or even re-builds, but there will come a time to do it. Make it easier by doing it often.

When working with older software, make sure others know about how painful it is, how much longer it's taking, and how it's not just a great thing we _should_ do. Make sure to either incorporate technical debt into the regular work cycle, or dedicate a block of time to tackle it. I'd rather tasks be easier, more fun, and take less time.
A laundry list of things I never heard of from bootcamp
Tags: beginners, career, discuss
Published: 2019-05-02 16:41:25

---
title: A laundry list of things I never heard of from bootcamp
published: true
description: Because it's just impossible to fit the dev ecosystem into a 10 week crash course
tags: beginner, career, discuss
cover_image: https://uvalaundryservices.com/wp-content/uploads/2015/08/Fotolia_27321216_L_RGB.jpg
---

These are not always necessarily useful on the job, but are somehow thrown around the industry. If you're someone who already knows HTML, CSS, and JS fundamentals, and are trying to get up to scratch like me... maybe you will find it useful. I also don't claim to know all the following areas and I lifted these from job posts,  chats with peers and hearsay while in junior roles. Take it with a grain of salt.

Several years ago I drank the koolaid and did a bootcamp. I shopped around carefully and wanted to specialize in javascript, because I wanted to animate things in browser as an artist. As an overachiever up until that point, I believed there was no problem learning whatever I put my mind to. I was wrong, and despite my enthusiasm for the subject I just wasn't able to carry-over any intermediate information to make logical conclusions. My teacher was able to pick up that I had ADHD (which upon seeking subsequent treatment for, has helped me also cope with mounting responsibilities etc)

Aditya Y. Bhargava's ["Grokking Algorithms"](https://www.manning.com/books/grokking-algorithms) has been particularly helpful in learning the first four concepts.

If anyone has anything else to add or wants to correct my assumptions of what's fundamental to a dev gig, feel free to add!

- Binary Trees

- Sorting algorithms/methods

- Whiteboarding

- Big-O notation

- Gitlab and Git Flow

- BEM and modular CSS

- Javascript patterns

- Functional Programming

- State management 

- Unit Testing

- Test Driven Development

- Style Guides

- Virtual machines and containerization

- Web sockets/Web hooks

"Nice to haves":

- GraphQL

- D3.js or WebGL  

- Deployment experience with Amazon Web Services
Android: Simple way to implement a SplashScreen in your app
Tags: android, kotlin, firstpost
Published: 2019-05-02 16:03:27

---
title: Android: Simple way to implement a SplashScreen in your app
published: true
description: 
tags: #android #kotlin #firstpost
---

#First of all, what is a SplashScreen? 

A splash screen is a screen which appears when you open an app on your mobile device. So, we can say it's the first impression for the user. It's usually used to show the logo of the app or an image related with the app.

In my personal opinion, this is the most simple way to implement a static splash screen.

So, let's code it. 

First of all, create a new android project with a empty activity called SplashActivity. 

Once that it's done we are ready to implement our SplashScreen:

##1. Create a custom style in styles.xml under the res/values folder.

<figure>
  <img src="https://i.ibb.co/HHWSVC9/Screen-Shot-2019-05-02-at-10-18-55.png" style="width:100%">
  <figcaption>Fig.1 - Theme for SplashScreen.</figcaption>
</figure>

##2. On the AndroidManifest.xml, add the theme we created before to the SplashActivity.

<figure>
  <img src="https://i.ibb.co/SsJbNdh/Screen-Shot-2019-05-02-at-10-29-48.png">
  <figcaption>Fig.2 - Add the theme to SplashActivity.</figcaption>
</figure>

##3. Add to the drawable folder any image you want, we gonna use it in the SplashScreen.

<figure>
  <img src="https://i.ibb.co/mDLsT8H/Screen-Shot-2019-05-02-at-10-34-20.png">
  <figcaption>Fig.3 - Drawable folder.</figcaption>
</figure>

##4. Modify the activity_splash.xml.

<figure>
  <img src="https://i.ibb.co/XWXnvMc/Screen-Shot-2019-05-02-at-10-38-08.png">
  <figcaption>Fig.4 - activity_splash.xml.</figcaption>
</figure>

##5. Add a new activity. I will called it MainActivity.

<figure>
  <img src="https://i.ibb.co/VWcbtj4/Screen-Shot-2019-05-02-at-10-42-09.png">
  <figcaption>Fig.4 - activity_splash.xml.</figcaption>
</figure>

##6. Now, implement this code in the SplashActivity. I'll use a Handler to create a small delay and then go to the MainActivity.

<figure>
  <img src="https://i.ibb.co/KqKhxmc/Screen-Shot-2019-05-02-at-10-53-46.png">
  <figcaption>Fig.5 - SplashActivity.kt.</figcaption>
</figure>

And that's all! You have a SplashScreen in your app. Of course, you can use an animation and make it really awesome but I'll show it in another post.

Thanks for reading!

Here is the repo just in case:

[Repo](https://github.com/AlonsoAndroidDev/SplashActivitySample.git)
Kite's AI Autocomplete for Python, Now on Linux
Tags: python, machinelearning, programming, datascience
Published: 2019-05-02 15:47:44

---
title: Kite's AI Autocomplete for Python, Now on Linux
published: true
description: Kite is now available on Linux! Get Line-of-Code Completions in your Python editor. We’re also announcing several improvements to our AI completions.
tags: python, machinelearning, programming, datascience
canonical_url: https://kite.com/blog/product/kite-adds-linux-support-opens-line-of-code-completions-to-more-python-devs/
---

![Kite for Linux] (https://thepracticaldev.s3.amazonaws.com/i/ul132zm5nghrwx3aq8t9.png)

After years of development and a whole lot of anticipation, Kite is now available on Linux! You can download it for free [here] (kite.com/download). Kite gives Python developers superpowers, including our Line-of-Code Completions, and integrates as a plugin into [PyCharm] (https://kite.com/integrations/pycharm), [IntelliJ] (https://kite.com/integrations/pycharm), [VS Code] (https://kite.com/integrations/vs-code), [Atom] (https://kite.com/integrations/atom), [Sublime] (https://kite.com/integrations/sublime-text), and [Vim] (https://kite.com/integrations/vim).

In order to provide you with a seamless experience, we’ve made sure Kite for Linux works on a number of Linux distros, including Ubuntu, Debian, Fedora, Arch Linux, Linux Mint, and openSUSE. It also works across a variety of desktops, including KDE, XFCE, Gnome 2, and Gnome 3.

While we first expected to ship support for Linux about a year and a half ago, we decided our core product needed more work before expanding our user base. We felt ready for more users after the launch of Line-of-Code Completions earlier this year, and we’re excited to share Kite with the Linux community now. Kite for Linux is much higher quality today than it would have been in 2017 or 2018.

###Completions improvements
Speaking of which, we wanted to share some of the progress we’ve continued to make on improving Kite for all our users.

First: more completions! We’ve optimized our type inference engine and added support for completions when users are typing in the middle of a name. As a result, Kite now shows ~1.4x more completions, as you can see here:

![Completions per day using Kite] (https://kite.com/static/media/image1.70c17af5.png)

We’ve also been busy improving Kite’s Line-of-Code Completions, which can predict up to the whole line of code you’re typing. We’ve seen a 2x increase in the number of times users select Kite’s Line-of-Code Completions as a result of this work.

As always, we’re hard at work enhancing Kite for you! Expect continued progress and even more integrations from here on out.

Check Kite out by downloading it [here] (kite.com/download).

And if you have feedback on Kite for Linux, we’d love to hear it! Simply email feedback@kite.com.

-The Kite Team
Maintaining multiple GitHub accounts with ease
Tags: github, git
Published: 2019-05-02 15:27:19

---
title: Maintaining multiple GitHub accounts with ease
published: true
description: 
tags: #github #git
---

I recently left a huge IT corporation for a promising startup.I was asked to change my GitHub handler name as it was too cool(I think) for them.Well instead of changing I created another account using my company email.

Now I got a problem.Every day when I come home and start hacking around my own projects I had to manually set my username and email id in git config in order to reflect my contributions in the graph and most of the time I forget to do so.

So I created some aliases to toggle between my two handles.

``` bash
# Set user 1 as current user
gitfirst() {
	git config --global user.email 'xxx.yyyy@gmail.com' && git config --global user.name 'mrprofessor'
  	gituser
}

# Set user 2 as current user
gitsecond() {
	git config --global user.email 'zzzzz@corporation.com' && git config --global user.name 'rudrabot'
  	gituser
}

# Print current user
gituser() {
	git config --global user.name && git config --global user.email
}
```

And that five minute I save every day from this hack..spends for...well I don't know.

Adios.

This post was originally published on [rudra.dev](https://rudra.dev)
Array.map() + async/await
Tags: javascript, async, typescript, map
Published: 2019-05-02 15:06:25

---
title: Array.map() + async/await
published: true
description: 
tags: #javascript #async #typescript #map
---

![Meow](https://thepracticaldev.s3.amazonaws.com/i/l3ox5viwvknip9apk49t.png)

> MDN Web Docs: The map() method creates a new array with the results of calling a provided function on every element in the calling array.

Today I found myself in a situation where I had to use an asynchronous function inside of an Array.map. Needless to say, Array.map is a synchronous function. Therefore, I had a slight problem in my hands.

I came across this problem while refactoring my code to get rid of a nasty “for..of”. Basically, I had an Array of objects upon which I had to make several calculations. One of these calculations involved making a call to an API which, of course, is asynchronous. Before my refactoring, I had no problem with using async/await inside my for..of loop. However, after making the switch to Array.map, I realized it wouldn’t be as simple.

Here’s what I did:


{% gist https://gist.github.com/NyaGarcia/7a47881a46eefd147a5763cf0a79125b %} 

<figcaption>Asynchronous Array.map()</figcaption>

As you can see, my getDistance function simulates a call to an API, and returns a Promise.

> Note: The return value of async functions is always a Promise

This means that our Array.map function will return an Array of unresolved promises. Therefore, outside of the Array.map, we have to wait for all the promises to be resolved before we can make use of the resulting Array. This is why we use Promise.all().

> Note: If you aren’t comfortable with async/await syntax, you can always resort to good ol’ “.then”

You can check out and play with my solution in the following CodePen:

{% codepen https://codepen.io/nyagarcia/pen/axXEWa/ %}

Pretty simple, right? It took me a while to figure it out…
Which is why I decided to share my solution, in case someone else encounters this issue. I hope it helps! Thank you for reading, feel free to share or leave a comment :)

P.S. You can check out my Github and Twitter pages if you like...
How to scale python server, for enterprise purposes?
Tags: discuss, python, scalability
Published: 2019-05-02 14:19:34

---
title: How to scale python server, for enterprise purposes?
published: true
description: 
tags: #discussion, #python, #scalability
---

I am investigating solutions on how to scale a flask-python API.

The solutions I have seen around (that are appropriate for enterprise level) are:

- Gunicorn with a few workers
- Celery or a similar technology for the tasks that are not trivial to finish
- Multiprocessing with a load balancer
- A combination of the above

Would you mind suggesting any other approaches you might have seen around or comment on the above?

For simplicity let's assume that there is no binding to specific cloud vendor.
MockIt: A tool to help developers mock endpoints
Tags: javascript, mock, api, http
Published: 2019-05-02 14:08:47

---
title: MockIt: A tool to help developers mock endpoints
published: true
description: A tool to quickly mock out endpoints, setup delays and more...
tags: javascript, mock, api, http
---

I would like to share with you an open source project I have been working on over the last month or so which can help developers mock HTTP endpoints.

https://github.com/boyney123/mockit

# The problem

When building applications you often need to interact with services. When the services are not ready to be consumed you have a few options:

- Mock out the response with a JSON file
- Create a mock service yourself
- Use MockIt.

# This solution

This tool was built and designed to help developers quickly create endpoints for their applications. No need to create a server or build the APIs, with docker you can run this project with one command. 

With MockIt you can create, edit and manage routes to your API. Every change to the API will be reflected on the server and updated straight away (live reload).

MockIt comes with a few features out the box:

- CORS
- Basic Authentication
- Chaos Monkey (Unleash a monkey to take down your endpoints)

If you want to know more about MockIt I have created a small introduction video for you (click on the image below)

[![Youtube Video](https://img.youtube.com/vi/Ns1SGH8k7oE/0.jpg)](https://www.youtube.com/watch?v=Ns1SGH8k7oE&t)


[https://github.com/boyney123/mockit](https://github.com/boyney123/mockit)
Introducing our May 2019 sponsors
Tags: meta
Published: 2019-05-02 14:08:19

---
title: Introducing our May 2019 sponsors
published: true
description: Our wonderful sponsors are vital to the health of dev.to and it is great to work with companies contributing so much to the ecosystem.
tags: meta
cover_image: https://thepracticaldev.s3.amazonaws.com/i/h8h236wv5pifvmtg9hc1.png
---

This May, we return two April sponsors and introduce a new partner for the month.  Thank you to each of those companies for being valuable DEV Community partners and supporters.

Please take a few minutes to explore their offerings and consider them for your company or next project.


## DigitalOcean

[DigitalOcean](https://do.co/devto) is a much-loved cloud computing platform. I'm always impressed by how well-built _and well-documented_ the DigitalOcean core products are. It's easier said than done, and they've been able to stay ahead of the curve.

DigitalOcean has been our longest-running supporter to date, and we're extremely thankful for their consistent support.  Their commitment to the developer ecosystem is crystal clear.

## GoCD

[GoCD](https://www.gocd.org/?utm_campaign=dev_to&utm_medium=dev_homepage&utm_source=logo_link&utm_content=gocd_homepage&utm_term=) is a continuous delivery tool built by Thoughtworks, one of the most reputable software development firms we've ever dealt with.

This is a feature-rich tool with some really fabulous visualization. Definitely worth considering for your organization or project. The product is very well supported through documentation, resources, and of course, the open source community. Very much worth checking out.

## Frontend Masters

[Frontend Masters](https://frontendmasters.com/?utm_source=devto&utm_medium=devtowebsite&utm_campaign=devtosponsor) produces modern courses for JavaScript, Node.js, React, Vue, Angular, Webpack, D3.js, Async JS and more.  They have a variety of paths established to help you learn new languages and level up your skills.

Their list of [teachers](https://frontendmasters.com/teachers/) is super impressive — you'll notice many familiar names.  If you're in the market to improve your programming skills via courses, definitely be sure to give FrontendMasters a close look.

***

These organizations are helping us build the best community we can. I urge you to check out their offerings if you are in the market for their services.

Happy coding ❤️
Structure project node js
Tags: node, javascript, react
Published: 2019-05-02 13:58:51

---
title: Structure project node js
published: true
description: Hello, I am a new beginner ty Node JS (work with PHP) and for learn i made a project basic auth. My code [GitHub](https://github.com/minority/node-react-mongo-auth/tree/master/api-server). And I would like to know if I chose the right structure and solutions for the project. Based on experience with php.
tags: Node.js, JavaScript, react
---

Hello, 

I am a new beginner to Node JS (work with PHP) and for learn i made a project basic auth rest and react client (in process). 
My code [GitHub](https://github.com/minority/node-react-mongo-auth/tree/master/api-server). 

I would like to know if I chose the right structure and solutions for the project. Based on experience with php.
How to navigate complex objects in 1 line of js
Tags: 1minjs, javascript, beginners
Published: 2019-05-02 13:52:32

---
title: How to navigate complex objects in 1 line of js
published: true
description: Explanation of a one-liner that makes your navigation in complex objects a breeze.
tags: 1minJS, javascript, beginners
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xvurlujpg29p2xmrrx1s.png
---


Today I want to share a pretty cool one-liner that makes your navigation in complex objects a breeze.. In just one minute 🤯
Let's get straight to the point.

```javascript

const navigator = (obj, path) => path.reduce((a, b) => a && a[b], obj);
```

Given an object and an array representing all the properties (in descending order) from parent to the target property, we can navigate to our target value. 

The native `Array.prototype.reduce` method is helping us achieve just that. 

*You can get familiar with `reduce` here:*
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce

We are providing our complex object as the initial value to our `reduce` method. And we are also providing a function that handles the reduction of our initial value.

We can then use the `navigator` function like that:

```javascript
// Test object
const test = {
  a: {
    b: {
      c: 'test',
    },
  },
};

navigator(test, ['a', 'b', 'c']); // 'test'
```

## The basic flow

Let's break it down what's happening in here:

➡ On first execution `a`, the accumulator, will have value `obj`.
➡ If `a[b]` exists, on the next iteration, `a` will be equal to `a[b]`.
➡ If `a[b]` is undefined, then `a` is our target value.

**NOTE:** Using the logical AND operator (&&), if both values are truthy, the second value will be returned.

## Looking for a more convenient syntax

The array notation to describe a nested path is not so handy.
But fortunately, we can upgrade it to a more convenient dot notation syntax pretty easily.

```javascript
// Splitting dot notation path => resulting in the array we need.
const navigator = (obj, path) => path.split('.').reduce((a, b) => a && a[b], obj);

```

Then we can finally use it like the following:
```javascript

const test = {
  a: {
    b: {
      c: 'test',
    },
  },
};

// 🎉🎉🎉🎉
navigator(test, 'a.b.c'); // 'test'
```

We have now the power to navigate very deeply nested properties with only one line of js 🎉🎉
Finding Hosts on Ansible Inventories
Tags: quickfix, protips, ansible, devops
Published: 2019-05-02 13:35:55

---
title: Finding Hosts on Ansible Inventories

published: true
description: 
tags: quickfix, protips, ansible, devops
---

I tend to work with a bunch of different servers when writing and testing tutorials. Even though I always organize my nodes into groups and give them alias to facilitate running commands and playbooks, it still gets a bit chaotic. I found myself having to open or `cat` the contents of my Ansible inventory many times a day to get IP addresses of servers I knew only by alias name.

I tried to find a native, neat way to get this info, but I couldn't. This is what I came up with :)


```
alias inventory="cat /etc/ansible/hosts | grep $1"
```

Now whenever I need to get the IP from a host in my Ansible inventory, I just run:

```
$ inventory mysql
```

And this is the kind of output I get:


```
[mysqlservers]
mysql1 ansible_host=165.22.254.246
```

Just remember to include the alias in your `.basrc` (or `.zshrc` if you use Zsh like me) file so the alias is preserved.
Git login with Netrc
Tags: git, netrc
Published: 2019-05-02 13:18:02

---
title: Git login with Netrc
published: true
description: 
tags: git, netrc
---

#### What is Netrc file ?
Netrc file contains user credentials and is used to auto-login. It is usually located in users home directory `.netrc` but location can be overridden with `NETRC` environment variable. Netrc also supports macros `macdef` to automate tasks. Netrc can be used with ftp, curl, git etc.

#### Netrc file:
- Create file named `.netrc` in home directory.
- Lets consider your git server is hosted on domain `git.company.com`

  ```bash
  ~ $ cat .netrc
  machine git.company.com
  login first.last
  password secret-password
  ```

#### Secure netrc file:
- As `.netrc` is used to store credentials, lets secure the file.

  ```bash
  ~ $ chmod 0600 ~/.netrc
  ```

That's it, next time when you use git for domain `git.company.com`, git should pick up the credentials on behalf of you ;)


#### Warning:
- Netrc stores credentials in plan text. This is how netrc is meant to be ;)


#### Use case:
- Its a good idea to use netrc when you have token based authentication.
- Automation for service accounts with token based authentication.