teleren/devto huggingface dataset:
Tudo que aprendi em 6 anos de profissão
Tags: frontend, career, tips
Published: 2020-03-27 20:01:58

Do alto dos meus 26 anos vejo como o tempo passou rápido desde os meus 19, parei por volta de um ano pra cuidar de outras áreas da vida, fui estudar Engenharia Civil e descobrir que não queria nada daquilo. Tive mil coisas me atrapalhando pra tentar ser uma desenvolvedora razoável, mas eu nunca deixei de fazer os meus projetos pessoais, nunca larguei de mão aquela paixãozinha que começou em 2005 quando tudo que eu queria era fazer um layout pro Blogger e ganhar um concurso de blog mais bonito/organizado. 

Nesses 6 anos trabalhando como front end e, muitas vezes, "designer" porque eu conseguia quebrar um galho pra empresa, me deparei com coisas incríveis e coisas bizarras, mas segue uma lista de lições que eu levo pra minha vida! E algumas que não servem só pra área de tecnologia. (:

- O básico é **o mais importante de tudo**, sem ele você não sai do lugar
- A maioria dos desenvolvedores sêniors só são sêniors por tempo de profissão, não exatamente por técnica, infelizmente
- Escute quem está na área a mais tempo, sempre! Mesmo que a pessoa não seja extremamente técnica, existe coisa que só o tempo vai trazer
- Um time é um time, não uma guerra de ego
- Humildade pra admitir erros e coragem pra apresentar alguma solução
- Grande parte das pessoas entendem que código bom é código complexo
- Grande parte das pessoas só fazem o item acima pra mostrar serviço
- Não importa se você tem dois anos de profissão e se considera sênior, tem muito problema e decisão que só pode ser tomada com a famosa vivência e presenciando muito absurdo
- Over engineering em projetos é mais comum do que se imagina
- Sempre vamos fazer algo errado, quase diariamente. E faz parte!
- As pessoas são **altamente influenciadas** por posts do Medium e artigos, mesmo se aquela solução não cabe no projeto
- Muitas empresas pecam na hora de dar atenção pra Devops
- Fazer coisas simples não te fazem ser menos do que alguém, faça coisas simples, mas faça bem
- Tecnologias nascem e morrem, volte ao primeiro item
- Nada é escrito na pedra, cada problema tem uma solução diferente, **tudo depende do cenário**
- Boa convivência com os colegas de trabalho é fundamental, em qualquer área, apoie as pessoas e não seja um imbecil

Essa é uma lista de tudo que tenho na mente de lições importantes, de aprendizados que levo na minha cabeça e no coração, independente da empresa que entro. Ter tudo isso em mente deixa as coisas mais leves, cada item desse foi uma surpresa pra mim em algum momento, e hoje em dia as coisas simplesmente são como são. Se divirtam com as coisas, isso que importa!
Moving Element In An Array From Index To Another
Tags: javascript, node, showdev
Published: 2020-03-27 19:52:55

---
title: Moving Element In An Array From Index To Another
published: true
description:
tags: #javascript #node #showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/0xm8z34lqde7doeuanpo.jpg
---

I was working on a project when I faced an unprecedented and obvious issue. How do I suppose to move an element in an array form one position to another?

My goal is to move an element in index-0 to index-2. Something like this:

```js
const input = ["a", "b", "c"];

const expected = ["b", "c", "a"];
```

The simplest way, using `splice()` which gives me the ability to add and remove elements in an array.

First, let's delete element in index-0:

```js
function move(input, from) {
  const numberOfDeletedElm = 1;

  // delete one element only, in index-from
  const arrDeletedElem = input.splice(from, numberOfDeletedElm);

  // ["a"]=["a", "b", "c"].splice(0, 1);

  // and input array is ["b", "c"]
}
```

But, I don't need an array, I only need the content of the `arrDeletedElem`.

```js
const elm = input.splice(from, numberOfDeletedElm)[0];
```

Now, let's add `elm` to index-2

```js
const numberOfDeletedElm = 0;

input.splice(2, numberOfDeletedElm, elm);
```

And our `move` function well be:

```js
function move(input, from, to) {
  let numberOfDeletedElm = 1;

  const elm = input.splice(from, numberOfDeletedElm)[0];

  numberOfDeletedElm = 0;

  input.splice(to, numberOfDeletedElm, elm);
}

// move(["a", "b", "c"], 0, 2) >> ["b", "c", "a"]
```

Of course, this can go deeper, that's why I created [move-position](https://github.com/jalal246/move-position). Which contains utility functions for moving index in an array.

Since releasing V1, [move-position](https://github.com/jalal246/move-position) can deal with the following cases:

1- Moving one element form/to index using: `move`.

```js
const input = ["a", "b", "c"];

// move element form index=0, to index=2
const result = move(input, 0, 2);

// ["b", "c", "a"];
```

2- Moves the same form/to index in multiple arrays using: `moveMultiArr`.

```js
const input1 = ["a1", "b1", "c1"];
const input2 = ["a2", "b2", "c2"];

const inputs = [input1, input2];

const result = moveMultiArr(inputs, 2, 0);

// result[0] > ["c1", "a1", "b1"];
// result[1] > ["c2", "a2", "b2"];
```
3- Moves multiple indexes in the same array using: `moveMultiIndex`.

```js
const input = ["a", "b", "c"];

const movingMap = [
  { from: 0, to: 2 },
  { from: 2, to: 1 }
];

const result = moveMultiIndex(input, movingMap);

// result > [ 'a', 'c', 'a' ]
```

And it's well-tested:

![test-result](https://dev-to-uploads.s3.amazonaws.com/i/cdfz7csr457axgwbqer6.gif)

---

Do you like it? Please leave a ⭐️. I appreciate any feedback or PRs 👋👋👋
Interconnect With PT Telekomunikasi Indonesia (Telkom)
Tags: github, tutorial, telecom
Published: 2020-04-09 22:22:48

---
title: Interconnect With PT Telekomunikasi Indonesia (Telkom)
published: true
date: 2020-03-27 19:12:04 UTC
tags: GitHub, tutorial, telecom
canonical_url: 
---

In this tutorial we demonstrate how you can interconnect with [Telin](https://www.telin.net) (By [Telkom Indonesia](https://www.telkom.co.id/sites)) in minutes. This adds another 0 hop & Open RTP carrier interconnection for you seamlessly. Telin made available to all [TelecomsXChange](https://www.telecomsxchange.com) (TCXC) members. You can utilize Telin’s direct routes immediately from [Market View](https://members.telecomsxchange.com/lookup.php). 

## About Telin

Established in 2007, Telin is a subsidiary of PT Telekomunikasi Indonesia (Telkom), Indonesia’s largest state-owned telecommunication and network service provider serving more than 200 million retail customers (including mobile, fixed broadband, and other subscribers).

Telin offers a comprehensive range of high-quality international carrier voice, data services, and business solutions aimed wholesale, enterprise, digital player, and retail customers with operations in Indonesia, Timor Leste, Singapore, Hong Kong, Australia, Malaysia, Macau, Taiwan, United States, Myanmar, and Kingdom of Saudi Arabia. Telin’s services include Voice, Data Connectivity, Internet & Content, Mobility, Enterprise Service, and Other Solutions.

For more details visit https://www.telin.net/

### How to Interconnect with Telin in minutes using TCXC platform:

1- Login to your [TelecomsXChange](https://members.telecomsxchange.com) Buyer Account

2- Navigate to [Market View](https://members.telecomsxchange.com/lookup.php) page

3- In Seller field enter **“Telin”** and click “Search”

4- Click on the **+** icon to purchase Telin’s routes

5- You will receive tech details (IP+Prefix) to start terminating to Telin from your allowed SIP servers IPs.

![](https://i2.wp.com/telecomsxchange.com/blog/wp-content/uploads/2020/03/Screen-Shot-2020-03-27-at-10.03.41-PM.png?fit=730%2C738&ssl=1)

### Benefits For Communication Providers 

- Better Quality of Service (QoS) for your customers
- Guaranteed Caller ID (CLID) Delivery
- Better Price 
- Open RTP (Direct Media Flow to Telin’s Infrastructure)
- Programmable API for prices, interconnection, Ticket escalation

### Interconnect with Telin via API

Developers may interconnect and interact with Telin’s routes and prices via API programmatically, to do this you may visit[TCXC developer documentation](https://documenter.getpostman.com/view/5344044/SVtbPk6K?version=latest#intro)for details.

The post [Interconnect With Telin In Minutes](https://telecomsxchange.com/blog/interconnect-with-telin-in-minutes/) appeared first on [TelecomsXChange Blog](https://telecomsxchange.com/blog).
Payforabill.com - Aid during this crazy time
Tags: react, webdev, showdev, startup
Published: 2020-03-27 19:07:12

Hi all,

once again I wanted to take a little time to show you all something else we have created. this is a dashboard where anyone (servers, wait staff, anyone) effected by covid19 can come and add their bills to our dashboard and hope that someone out their will take care of one of their bills for the month. 

If you have any questions please comment below or email us at info@jhobbie.com 

If you dont mind also, please share the link of payforabill.com and give us some love on producthunt as well at https://www.producthunt.com/posts/payforabill-place-to-help-others

Thank you!
Covid19 pandemic charts
Tags: covid19, go, apexcharts, ecdc
Published: 2020-03-27 18:56:07

[check it out](https://covid19.fayzlab.com/)

There are numerous covid19 resources out there at this point. People use different resources in a different way to understand the spread of the virus. I found other resources a bit limiting except this [one](https://covid.amcharts.com/). But anyway being a dev, i had an itch to create my own, or something to help me see what i wanted to see during this tragic time. 

Now that i have it, i want to share it, i have created a log where i will check everyday who visited my charts :D sad! i know.

Good luck people! stay safe!
Show and hide the password in angular
Tags: angular, javascript
Published: 2020-03-27 18:42:11

Because life's too short to waste time re-typing passwords. Click on the eye icon to view the typed password using angular/javascript. here we go!

### your html/markup looks something like this:

```html
<div class="md-form form-sm password-div">

 <input type="{{showPassword ? 'text' : 'password' }}" class="form-control form-control-sm">
 <label>Password</label>

 <a (click)="togglePassword()" class="eye-b">
  <i class="{{showPassword ? 'fas fa-eye-slash' : 'fas fa-eye' }}"></i>
 </a>

</div>
```
### your ts/js looks something like this:

```javascript
  showPassword: boolean = false;

  public togglePassword() {
    this.showPassword = !this.showPassword;
  }
```
### your scss/css looks something like this:
```scss
.password-div{
  position: relative;
 .eye-b {
  color: #ccc;
  position: absolute;
  top: 9px;
  right: 10px;
 }
}
```

### That's all...

![enjoy](https://gifimage.net/wp-content/uploads/2017/11/enjoy-gif-9.gif)
Wizar devlog 10 - hell of TS bundling
Tags: typescript, bundle, npm
Published: 2020-03-27 18:35:49

This week was less productive due to conainment and I spent my time to struggle on how to compile a TS package for NPM and browser whithin a single file.

To be quick, here are the two most important thing I found:

## I use Rollup to compile my TS in a single file.

It is straigh forward and really 0 config. My main issue is that I used a monorepo and one of my package used another one.

In this case you have too start your script in the **root folder** of your monorepo. Otherwize you will end with: `"Debug Failure. False expression: Expected fileName to be present in command line"` 

## My main file exports explicitely each end point of my API.

It is the most important thing that I learnt because Rollup will reduce your package as a single file, but the declaration files will mirror your source hierarchy.

This will result in a "myModule is not a module" error when you will consume the package.

To fix this, you "just" need to write your main entry file like this:

```ts
export {
 string,
 number,
 boolean,
 undefinedType,
 unknown,
 array,
 object,
 map,
 reference,
 identifier,

 component,
} from "./ravioli"
```
It is tedious but note that is the occasion to clean your code and export only what is needed (instead of export everything "just in case"). You minified code will be smaller (because exported things are not rewritted by the minimifier)
Instance variables in Imba v1 and Imba v2
Tags: imba, youtube
Published: 2020-03-27 18:32:40

Here is a cool screencast shared on the [Imba Discourse](https://users.imba.io) about instance variables in Imba by [Julien Lancaster](https://github.com/JulienMLan). Good and honest feedback.

Imba is moving fast so somethings might not be true forever but, enjoy :smile:

{% youtube btUkOcClDMg %}
Refactoring JavaScript using JavaScript
Tags: todayilearned, javascript, metaprogramming, video
Published: 2020-03-27 18:23:29

---
title: Refactoring JavaScript using JavaScript
published: true
description: With codemods, engineers can programmatically refactor their code, saving hundreds of hours while reducing tech debt. I’ll share my love, struggles, and successes applying them in a large codebase. We’ll see my favorite codemods along with tips on how to use them effectively, and also write one from scratch.
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/xraq8pad063i0kchujod.jpeg
tags: todayilearned, javascript, metaprogramming, video
---
*As we look ahead to [CascadiaJS 2020](https://2020.cascadiajs.com) (🤞🏽) I thought I'd share some of the awesome talks from our 2019 event. Enjoy!*

## Saimon Sharif

![saimon sharif](https://begin-static-p6uw2-production.s3.us-west-2.amazonaws.com/forest-1dg/images/speakers/saimon-sharif.jpg)

With codemods, engineers can programmatically refactor their code, saving hundreds of hours while reducing tech debt. I’ll share my love, struggles, and successes applying them in a large codebase. We’ll see my favorite codemods along with tips on how to use them effectively, and also write one from scratch.

[Watch the talk (24:22)](https://youtu.be/t8aQ5zVaEgU)
Create a Custom Wordpress Theme from Template
Tags: tutorial, webdev, wordpress, theme
Published: 2020-03-27 18:01:32


While I typically stick to front-end design & HTML & CSS on my YouTube, this new series is covering creating a custom WordPress theme from scratch!  Part 1 out today, with the rest coming shortly.
___
Please consider subscribing to the [YouTube Channel!](http://www.youtube.com/FollowAndrew?sub_confirmation=1)
___
{% youtube ZJKAwJq9_xM %}

The first series covers setting up our WordPress theme files & folders and talking about which of those are required.  We'll setup our screenshot, style.css file (which WordPress requires in order to install the theme) and all the template PHP files and get our theme activated.

Hope this helps out the folks who are starting out developing or working in the WordPress platform.
Svelte Development with VSCode Remote - Containers
Tags: svelte, vscode, docker, webdev
Published: 2020-03-27 17:56:40

---
title: Svelte Development with VSCode Remote - Containers
published: true
description: A VSCode Remote Container for Svelte web app development
tags: #svelte, #vscode, #docker, #webdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y40e2ygfq99o65qop82h.png
---

As my first post here, I thought I would write about three of the favorite things I have been using/learning lately:
- [Visual Studio Code](https://code.visualstudio.com/) Code and the [Remote Development extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack)
- [Docker](https://www.docker.com/products/docker-desktop)
- [Svelte](https://svelte.dev/)

The combination of VSCode and the Remote Development-Containers with Docker has really changed my workflow for web apps and python apps.

And as someone still learning front end web development, I found that I really enjoy developing with Svelte over React and Vue (although I still like Vue).

The repo below contains a full development environment to get up and running with Svelte in VSCode in a few simple steps without having to worry about installing anything on your local machine other that VSCode, the Remote Development extension, and Docker.

After cloning the repo, you just need to open the folder as a remote container and you now have an Alpine Linux host with Node, Yarn, and Svelte ready for development.

Also, no need to worry about which extensions for VSCode to install, the remote container already has ESLint, Prettier, and Svelte-VSCode extentions for VSCode installed.

Please give it a try and let me know what you think.  Next up will be development container with Svelte-Sapper.

{% github patrickneise/vscode-remote-svelte no-readme %}
day 87
Tags: workfromhome, lockeddown, covid19, whichdayitis
Published: 2020-03-27 17:26:09

Quite an unusual title to a post? well, thanks to what's happening around the globe at the moment. Schools, Offices are closed and it's been 2 weeks since I am working from home. Luckily, we are still allowed to go out but maintain the physical distance so that means there are no small talks with strangers or "hi/hello's" as well.

Since I have started this WFH thing, I have lost the track of which day of the week it is? or what is today's date? I am no longer happy about Friday's or sad about Monday's since it's so damn difficult to remember... hence day 87!

Due to this COVID-19 situation, life has changed on many fronts, some good things first
 
* like my hands were never clean this before
* I used nail cutter to cut my hand fingernail, well I am a developer and while thinking about code nail bitting happens (_i tried for many years to get rid of this but looks like I will succeed this time_)
* I get to play with my son during the day, take him for a walk or just random chat
* Finally ordered monitor for my Laptop and table and chair and keyboard... after deliberately delaying it for 3 years, I will be having proper setup at home.

Now the bad things,

* There is no difference b/w home & office, I loved to WFH initially but the fun vanished within a week, now I want to go back to the office
* working on 15.6" laptop screen from two 24" monitors, is really really painful and slow
* let's just say, Webex has a lot of scope for improvement :( 
* Missing "Happy Friday, Boring Monday's"!
* Probably in a month I will gain weight .. from 16km daily cycling to 0, plus no movement at all

Well, I hope this coronavirus thing settles soon ... now, moving on with life, to, day 88...
What was your win this week?
Tags: discuss, weeklyretro
Published: 2020-03-27 17:24:48

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

👋👋👋👋

Looking back on your week -- what was something you're proud of?

All wins count -- big or small 🎉

Examples of 'wins' include:

- Getting a promotion!
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄

![dog-on-couch](https://media.giphy.com/media/3o85xCVh0TmBrQr36U/giphy.gif)

Happy Friday!
VSCode autocomplete on private package import do not working
Tags: python, vscode, help
Published: 2020-03-27 16:52:58

Vscode autocomplete do not working when i import my private package from git and shows this message error on code line: `Unable to import 'elixir_tools' pylint(import-error)`

my setup.py structure:

```
from setuptools import setup

setup(
    name='elixir_tools',
    url='***',
    author='Elixir AI',
    author_email='***',
    packages=[
        'elixir_tools',
        'elixir_tools.executors',
        'elixir_tools.models',
        'elixir_tools.transforms',
        'elixir_tools.utils'
    ],
    install_requires=[
        'pandas',
        'numpy',
        'datetime',
        'xlrd',
        'psycopg2-binary',
        'flask_bcrypt',
        'flake8',
        'bayesian-optimization',
        'scikit-learn',
        'python-dateutil',
        'xgboost',
        'croston'
    ],
    version='0.1',
    license='MIT',
)

```

any suggestion?
React-explode second version 🎉
Tags: react, javascript, webdev
Published: 2020-03-27 16:51:51

Today I am delighted to announce the second version of React explode. 🎉🎊

My favorite new explosion is Luzon, please tell me what is your favorite.

Check it out: https://github.com/bigfanjs/react-explode
And please share if you like it.
Hosting a Hugo site on AWS S3 and CloudFront
Tags: hugo, aws, s3, cloudfront
Published: 2020-03-27 16:50:39


In the early days we used Wordpress as our go-to-CMS. Over the years however we have seen examples of these blazing fast lightweight sites built on top of static site frameworks such as Hugo. These sites had the following advantages over Wordpress:

- Super fast (no server side logic at all)
- Secure (there is no login system to brute force - it's just static files)
- Easy to version control
- Easy and cheap to host (no need for a database or backend hosting)

So for the site you are looking at right now (Mocki.io) we chose to go with Hugo. We picked it up quickly and started building out the site still amazed at the speed it serves content. There were however some challenges. Our tech stack is hosted 100% on AWS and we quite like it. Naturally, we chose to deploy this site to AWS as well and the clear choice was S3 which is a static file hosting service. For CDN we chose AWS CloudFront which is super powerful. Deploying the site was quick and S3 + CloudFront served the content at blazing speed.

Of course there were challenges... our previous site did not have trailing slashes in the URL (example.com/page) while Hugo forced us to have trailing slashes (example.com/page/). For SEO reasons we wanted the exact same URL structure as the previous site. When looking in the Hugo documentation it did not have support for that. We also wanted to redirect www.example.com to example.com to make sure there was only one domain you could reach our site on.

To solve this we used Lambda@Edge. An [AWS Lambda function](https://aws.amazon.com/lambda/) is a piece of code that is deployed and run in the cloud. Lambda@Edge is a Lambda function that you can trigger when someone accesses your site through CloudFront. So we wrote a Lambda that removes the trailing slash and redirects the www domain to the non www domain. It also routes the requests from CloudFront to S3 so that the correct HTML-file is fetched from S3.

We put the entire setup in a CloudFormation template that you can deploy in one single command. You can access the code to deploy your own Hugo site on AWS here: https://github.com/keaeriksson/hugo-s3-cloudfront.

The result solved most of our SEO challenges that we had while still keeping the advantages of building the site with Hugo.

Feel free to reach out if you need more advice on hosting static sites on AWS using the chat in the bottom right.

Cheers!