teleren/devto huggingface dataset:
I18n process for a Phoenix app?
Tags: dicuss, question, phoenix, i18n
Published: 2019-12-09 11:09:42

I would love to hear about your experiences with translating Phoenix apps. I'm interested both in maintaining an app with many languages, and adding a totally new language to an existing app.

- What does the process look like? 
- Which tools do you use to allow translators work on the translations?
- Do you even have dedicated translators?
- How do you provide context for the translators so that they know what exactly they're translating? Working in pairs with someone who knows the app, writing descriptions, attaching screenshots? Or are you able to do in-app translations with some JS magic?
- Do you use Gettext or something else? Do you use more than one Gettext domain?
- How many languages do you have to handle?
- What is the biggest pain point of your process?
- How do you handle quality assurance of the translations?

Any and all answers will be appreciated!
Snowman
Tags: codepen, snowman, css
Published: 2019-12-09 11:08:50

---
title: Snowman 
published: true
tags: codepen, snowman, css
---

Please add your likes in CodePen, for a funny attempt at a snowman challenge we have within our company :)

{% codepen https://codepen.io/ilesh/pen/BayoogM %}
Deploy every Friday
Tags: continuousdeployment
Published: 2019-12-09 11:07:01

---
title: Deploy every Friday
published: true
description: We can do better than only feeling confident to deploy for 80% of the working week.
tags: [continuousDeployment]
---


Every Friday I see people on Twitter shouting about how it's #noDeployFriday. And every Friday, I deploy to production anyway. 

Do I hate quiet weekends? Not at all. I moved to full continuous deployment because I wanted quiet days, evenings, *and* weekends. 

I got here by moving to continuous deployment.

I once worked for a company that had a painful release cycle. Everything had to stop once a month, and everyone spent the  period immediately afterwards fixing issues. 

Once I was in a position to own my own team's pipelines I wanted things to be better. 

I started out with continuous integration (CI). Every change that we made was automatically tested and compiled, and the team was automatically notified of the build result.

This saved the team a lot of time, but I wanted more. 

##Moving to continuous deployment (CD)

How could I be sure that everything was ready to go to production all the time? My work could be categorised in two ways:

### 1: Changes to pages that were already available to users

Feature flags were enough to ensure that these changes didn't prematurely become accessible to users.

### 2: Changes to pages that weren't yet available to users 

I decided to extend this idea a little further here. I already had a mechanism in the application to denote available pages, so I extended that to enable/disable entire pages easily based on the user's environment.

![A function that returns true or false based on which page is loaded in combination with an environment type](https://thepracticaldev.s3.amazonaws.com/i/9gcslo7ippfn2bojvegb.png)

Now I had everything I needed to turn on automatic deployments.


##And everyone lived happily ever after, right?

Well, sort of. There were a couple of things that we hadn't quite accounted for: 

###1: You can still make mistakes, but now your users can see them

It only took one bug to accidentally put a page live. This taught me that I needed an extra safeguard. 

I added automated tests to check the status of each page. This meant a small overhead when making a new page available to users, but eliminated the possibility of users accessing pages before they were ready.

###2: Caches can trip you up sometimes

My application is being served by AWS Cloudfront, which is known to cache aggressively. I initially invalidated this cache manually, but this wasn't good enough after moving to CD. This was easily fixed by amending the pipeline to invalidate the cache every time it ran.



I deployed over 70 times last week alone without worrying how close it was to 5pm, or what day it was. It's scary to begin with, but it's worth it. 

"#NoDeployFridays"? No thanks. 


###Things mentioned in this post

[Feature flags](https://www.martinfowler.com/articles/feature-toggles.html)
Angular Router • Popstate blocked
Tags: angular, typescript, javascript
Published: 2019-12-09 11:04:00

There is my solution to block the popstate event in Angular world.

```typescript
import { Location } from '@angular/common';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  constructor(
    private location: Location,
    private router: Router
  ) {
    this.router.events
      .pipe(
        filter(
          (event: NavigationStart) => event.navigationTrigger === 'popstate'
        )
      )
      .subscribe(() => {
        this.router.navigateByUrl(this.router.url);
        this.location.go(this.router.url);
      });
  }
}
```

### How it works ?

First of all, listen router events and filter on navigationTrigger (only NavigationStart). If "popstate" value, apply the logic.

#### Wait, why two actions ? 🤔

```typescript
this.router.navigateByUrl(this.router.url);
```

> Angular navigates on the last route without reloading the page (no guards triggered again)
>
> __But browser perform real navigation !__
> If you click again on back button, browser navigation __continues__

#### How to freeze browser URL when popstate ?

```typescript
this.location.go(this.router.url);
```
> `location.go` method rewrite browser URL _WITHOUT_ reloading the page.


### ENJOY !! 🔥🚀
How to Install Node.js using NVM on Linux
Tags: nvm, linux, node, tutorial
Published: 2019-12-09 10:54:15



NVM aka `Node Version Manager` is a simple bash script to manage active Node.js versions. Using NVM you can easily install Node.js and also you can install a specific Node.js version or multiple Node.js versions on the same system.

## STEP-1: Install NVM

To install or update NVM, you need to run the install script. Use the following command to install NVM on your Linux machine.

```sh
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
```

Reload system environment using this command:

```sh
source ~/.bashrc     
```
It will set the required environment variables to use nvm on the system.

**Verify NVM**
Run the following command to check if the nvm is installed:
```sh
command -v nvm
```

If it's installed correctly, you will see
```sh
nvm
```
as message printed.

## STEP-2 Find Node.js version

As now NVM is installed in your system, find out the available Node.js version to install. You can run the following command to find out:

```sh
nvm ls-remote
```

A long list of available Node.js versions is printed:
```sh
       . . .
       v10.12.0
       v10.13.0   (LTS: Dubnium)
       v10.14.0   (LTS: Dubnium)
       . . .
       . . .
       v10.17.0   (Latest LTS: Dubnium)
        v11.0.0
       . . .
       . . .
       v12.12.0
       v12.13.0   (LTS: Erbium)
       v12.13.1   (Latest LTS: Erbium)
        v13.0.0
        v13.0.1
        v13.1.0
        v13.2.0
        v13.3.0

```

## STEP-3 Node.js installation

Now install the Node.js version you need to use.
```sh
nvm install v12.13.1
```
You can install multiple versions as well, just specify the version you want to install: `nvm install $version`.

## STEP-4 Set default version

If you have installed multiple Node.js versions, then select a specific version as default version of Node.js used by your machine.
Run the following command to get the list of currently installed Node.js versions
```sh
 nvm list
```
you will see similar output:
```sh

->     v10.16.3
       v12.13.1
         system
default -> v12.13.1
node -> stable (-> v12.13.1) (default)
stable -> 12.13 (-> v12.13.1) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/erbium (-> v12.13.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.16.2 (-> N/A)
lts/dubnium -> v10.17.0 (-> N/A)
lts/erbium -> v12.13.1

```
You can see that `v12.13.1` is set as the default version. You can use the following command to change default version:
```sh
nvm use v10.16.3
```
Now, verify the current version of Node.js

```sh
  node --version

v10.16.3
```

If you want to uninstall a specific version of Node.js, you can use the following command:
```sh
nvm uninstall v12.13.1
```

I hope this tutorial helps :)
JavaScript and ES6 - The Confusion
Tags: javascript, ecmascript, es6
Published: 2019-12-09 10:49:01

Here is my first ever techblog on JavaScript and ECMAScript Dilemma.This blog speaks to my present Knowledge of the differences among JavaScript and ECMAScript.Go catch up the blog at : http://bit.ly/ShivanshJSvsES6 . Do give it a read and a clap . Also share your views on it.😍
Eyowo-php: A PHP Wrapper for Eyowo API
Tags: php, eyowo, api
Published: 2019-12-09 10:01:30

Over the weekend, I decided to go through [eyowo](https://eyowo.com/) API docs. I attempted to consume the APIs using PHP.



The API docs include sample codes for curl, javascript, kotlin, ruby and java. No sample codes for PHP yet.



So, I went ahead to create a PHP wrapper for the API, for those who might want to use the API in their PHP application. The package named eyowo-php is framework-agnostic, meaning it can work in any PHP framework or application.



Go ahead and check it out here [https://github.com/djunehor/eyowo-php](https://github.com/djunehor/eyowo-php)
DEV users landscape
Tags: showdev, javascript, dev
Published: 2019-12-09 09:38:39

---
title: DEV users landscape
published: true
description: Use dev.to API to aggregate users data
tags: showdev, javascript, dev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/icw4e5oi5gsc1t5vqzpw.jpg
---

One day I was reading [DEV](https://dev.to) and noticed [Ben](https://dev.to/ben)'s [post](https://dev.to/devteam/special-announcement-from-the-dev-founders-hel) saying that there are more than 250k registered users. "Wow, that's a lot" I thought.

Couple of weeks later I saw the [post](https://dev.to/alfredosalzillo/the-state-of-devto-v0-api-1o2) describing the current state of DEV API. And I thought it'd be interesting to have a bird eye view on the DEV users landscape.

![Later](https://thepracticaldev.s3.amazonaws.com/i/v9yf60gk3i1dvyh6ci4r.jpg)

And [here we go](http://dev-users.surge.sh/)
![landscape](https://thepracticaldev.s3.amazonaws.com/i/gnm1415pkq38y4a2bai8.jpg)
Features:
- 250k user avatars in one place
- hover on an avatar to reveal username
- click on a user avatar for more info on dev.to website
- search for a user
![Search](https://thepracticaldev.s3.amazonaws.com/i/e92f6odjnbkncfgqmtsx.jpg)

P.S.
There are _just_ 250k users, so users registered after mid of October 2019 are not included.

### Technical details

- I used chunks promise pattern to fetch the users data with Node.js
{% link https://dev.to/karataev/handling-a-lot-of-requests-in-javascript-with-promises-1kbb %}

- Avatars were merged into big images with [canvas](https://www.npmjs.com/package/canvas)

- There are 25 images, each image contains 10k users

- React for UI

Let me know if you have any questions 🙃
I am fed up with answering the same questions in interviews! - Are you too?
Tags: discuss, career, interview, watercooler
Published: 2019-12-09 09:22:29

###**DevRecruitmentThoughts**

One of the frustrating things with the current state if tech recruitment is the repetition in interviews with different companies.

In the couple of interviews that I went through I ended up explaining the garbage collector in Java in at least 4 companies and had to answer: what are generics in Java? at least 3 times.

This problem is not easy solvable because each company needs to check if the candidate is competent.

One solution might be having some sort of knowledge / skill proof that you do once and just show it to the company, so that the interviewers can focus on the more specific question.

One caveat: I don't mean here a certification or a state exam but more like a real skills vetting process. (perhaps a coding session)

Now, there are a few problems with such an approach:
- who should organize it and how the companies could trust this organization
- should one be allowed to repeat the test more times?
- how do you make sure that it verifies the skills that are important?


They are not easy to solve but if they would be, the industry would benefit from it immensely.

What is your opinion?
THE DOM, THE DOM, THE DOM, What exactly is that?
Published: 2019-12-09 08:35:47

I wrote HTML, CSS and Javascript codes up to 3 years ago without understanding the exact meaning of the DOM, in fact, I used to think my HTML  code was the DOM, even though I made constant use of it. Weird right? 

SO WHAT EXACTLY IS THE DOM?

The DOM stands for the Document Object Model.

The MDN Web Docs defines the DOM as "a programming interface for HTML and XML documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects. That way, programming languages can connect to the page."

Simply put, the DOM is an API to web pages. This is why programs like javascript can manipulate and change it. 

You must have also heard some people refer to the DOM as a Tree. 

![dom tree](https://www.tutorialrepublic.com/lib/images/html-dom-illustration.png)

From the image above, you can see the tree-like structure, people refer to it as a tree because the DOM starts with a single parent item that branches into children items and even more children items.

Note that the DOM is not;

1. the same as your HTML source code even though it is created from 
   there: this can be verified from an instance when you mistakenly leave 
   out a required element. You'll notice it in the DOM even though 
   you've left it out of your HTML. also after modifying the DOM with 
   Javascript, you'd also notice that the DOM is different from your HTML 
   source code.

2. the same as what you see in the Dev tools: If you're familiar with the 
   dev tools, you'd notice that it adds additional information that is 
   not in the Dom such as Pseudo-elements created using the ::before and 
   ::after selectors, but these are not in the DOM.    

In part 2 of this article, I will discuss how you modify the DOM with Javascript.

Summary:

* The DOM is an API for HTML and XML documents. It represents the page so 
  that programs can change the document structure, style, and content. 

* The DOM is not the same as your HTM source code even though it is 
  generated from it.

* The DOM is not the same as what you see in the Dev tools because the 
  dev tools contains extra information like the pseudo-elements (::before 
  and ::before)

Super thanks for reading my article about the DOM. Kindly follow me on twitter @tech_bella for interesting Tech tweets. You can ask questions or make comments in the comment section below.
Day 9 of the Visual Studio Tips Advent Calendar is now live
Tags: visualstudio
Published: 2019-12-09 08:10:14

Day 9 of the Visual Studio Tips Advent Calendar is now live. Enjoy! 

Be quick! (Little hint what the tip is about today)

https://visualstudiotips.co.uk/calendar/

#VisualStudio #DevDecember #VsTipsAdvent #Advent
Algorithm Grinding
Published: 2019-12-09 07:58:09

I've been told that as an entry level developer, the best thing that I can do to practice for interviews is to grind out algorithms. Many companies will require a show of skill as part of their suite of interviews, and constantly doing and redoing algorithms will definitely keep you in good practice for this leg of your journey.

There are some amazing resources out there for practicing algorithms. So far, I've been using leetcode.com and sticking to core constructs like binary trees, hash tables, linked lists, etc, as these algorithms are more likely to show up in entry-level interviews. After talking with some senior developers, I've started incorporating a timer into my practicing. I will pick three algorithms that I focus on for any one session and cycle through each one of them until I can solve them under twenty minutes each. As I get more comfortable with the algorithms I'm practicing, I will try to code them in different languages to give myself another challenge.

If you want to practice algorithms to prepare for interviews, or just for fun, here are some useful links:

https://leetcode.com/problemset/algorithms/
https://www.hackerrank.com/domains/algorithms
https://coderbyte.com/
https://www.hackerearth.com/practice/
https://www.codewars.com/
Answering: How to adjust the 4th image column to make it a responsive image gallery
Tags: html, css, flex, gallery
Published: 2019-12-09 07:38:40

So, somebody asked about CSS flex-based image gallery. 

He want to make a responsive image gallery with CSS' flex. Four columns on desktop and three columns around the tablet viewport.

I think the problem is in his HTML structure. So, I restructure it.

Check my answer below and please correct me if I'm wrong, or help him with better and clean-code solutions, maybe?

{% stackoverflow 59176800 %}
Advent of Code 2019 Solution Megathread - Day 9: Sensor Boost
Tags: adventofcode, challenge, adventofcode2019, spoilers
Published: 2019-12-09 07:27:03

---
title: Advent of Code 2019 Solution Megathread - Day 9: Sensor Boost
published: True
description: Well, that IntCode interpreter is back, and it hates us.
tags: adventofcode,challenge, adventofcode2019, spoilers
series: Advent of Code 2019 Solutions
cover_image: https://i.imgur.com/bU5NZe3.png
---

Oh no, IntCodes! (I'm starting to see a pattern here...)

### [Day 9 - The Problem](https://adventofcode.com/2019/day/9)
After an easy decryption of an image file, we're back in our module and speeding through the solar system.  Unfortunately, we seem to have picked up a distress beacon! What is it saying? We must update our IntCode interpreter to find out!

Part 1 seems simple enough: Add big number support and a new relative parameter addressing system.

And after whacking our heads against the wall on why relative mode wasn't working the way we thought it should for too long, Part 2 is "merely" the same as part 1, but potentially very slow. If you weren't careful, your solution might be running for a _long_ time.


### Ongoing Meta

#### Dev.to List of Leaderboards

* `120635-5c140b9a` - provided by [Linda Thompson](https://dev.to/lindakatcodes) 

 If you were part of [Ryan Palo](https://dev.to/rpalo)'s leaderboard last year, you're still a member of that! 

If you want me to add your leaderboard code to this page, reply to one of these posts and/or send me a DM containing your  code and any theming or notes you’d like me to add. (You can find your private leaderboard code on your "[Private Leaderboard](https://adventofcode.com/2019/leaderboard/private)" page.)

I'll edit in any leaderboards that people want to post, along with any description for the kinds of people you want to have on it. (My leaderboard is being used as my office's leaderboard.) And if I get something wrong, please call me out or message me and I’ll fix it ASAP.

There's no limit to the number of leaderboards you can join, so there's no problem belonging to a "Beginner" *and* a language specific one if you want.

#### Neat Statistics

I'm planning on adding some statistics, but other than "what languages did we see yesterday" does anyone have any ideas?

##### Languages Seen On Day 08

* javascript x 4
* kotlin x 2
* python x 2
* PHP
* clojure
* perl
* swift

##### Completion Stats

By applying a best-fit descending power trend-line to the 1 and 2 star  columns on the [stats page](https://adventofcode.com/2019/stats), my estimates predict:

1 star on day. 25: 6358 people

2 stars on day 25: 420 people. <sub>_Nice_</sub>

If you're still going, take heart in that you are in a _rapidly_ dwindling pool of people.

Doing other questionable statistics gives me: 415/6248
DeepSource Go analyzer is now generally available
Tags: showdev
Published: 2019-12-09 07:14:35

<p class="dropcapped">Go programming language has taken the developer ecosystem by storm. Since it's creation in 2009, the language has seen tremendous global adoption by developers looking for a lightweight as well as expressive language suited for microservices architectures. It has been touted to be on a trajectory to become the next <a href="https://hackernoon.com/go-is-on-a-trajectory-to-become-the-next-enterprise-programming-language-3b75d70544e" target="_blank">enterprise programming language</a>.</p>

DeepSource Go analyzer is now generally available and is free to use for open-source repositories.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/tf1b2n41d1mdz77af82i.png)

## Issue distribution

The analyzer detects 150+ types of issues falling into the following categories &mdash; bug risks, anti-patterns, security vulnerabilities, performance issues, documentation coverage and style violations.



Here's quick overview of some sample issues from each of these categories.

#### Bug risks

- Incorrect usage of `append`
- Using `defer` in infinite loops which will never execute
- Invalid regular expressions
- Assignment to `nil` map

#### Security vulnerabilities

- Poor file permissions
- Binding to all interfaces
- Hard-coded credentials in source code
- Use of un-escaped data in HTML templates

#### Performance issues

- Storing non-pointer values in `sync.Pool`
- Using `time.Tick` in a leaky way
- Optimizations when indexing maps by byte slices

#### Anti-patterns

- Duplicate build constraints
- Trapping signals like `SIGKILL` and `SIGSTOP` that can't be trapped
- Redundant control flows
- Missing error checks

#### Style violations

- Incorrectly formatted error string
- Misplaced `default` case in switch statements

## Getting Started with GitHub

Analyzing Go code with DeepSource is straightforward. Just add a `.deepsource.toml` file to the repository root to tell DeepSource which analyzers to run. The following example configuration will run go analysis continuously on all pull requests.

File: `.deepsource.toml`

```toml
version = 1

test_patterns = [
  "tests/*_test.go",
  "**/*_test.go"
]

[[analyzers]]
name = "go"
enabled = true

  [analyzers.meta]
  import_path = "github.com/username/repository"
  
[[analyzers]]
name = "test-coverage"
enabled = true
```

## Tracking test coverage

You can also track test coverage for your Go code. Post enabling test coverage analyzer (above step), use DeepSource CLI to report metrics from any CI systems.

```bash
# Run your tests and generate coverage report
go test -coverprofile=coverage.out

# Install 'deepsource CLI'
curl https://deepsource.io/cli | sh

# Set DEEPSOURCE_DSN env variable from repository settings page
export DEEPSOURCE_DSN=https://sampledsn@deepsource.io

# Report coverage artifact to 'test-coverage' analyzer
./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.out
```

Go build.
2019 Holiday Giveaway from ContestKit
Tags: laravel, php, giveaway, contestkit
Published: 2019-12-09 07:04:43

Good News, there is a very good people has created an event [giveaway](https://laravelgiveaway.com/c/2019?utm_campaign=Inggih+referral&utm_source=share&utm_medium=referral_url&utm_referral=Q7C6GWur) that has many prize every week this event, whos that? 

> Hello, my name is Yaz. I am the founder of ContestKit. I love Laravel and the Laravel community, so I decided this year I want to do something to give back in a fun way. I decided to run this massive giveaway of all the amazing products and services I use every day in my workflow, as well as courses, swag, and more.

Check this official this [Official Laravel News Post](https://laravel-news.com/2019-holiday-giveaway)