teleren/devto huggingface dataset:
The Ninja Vault, now with previews!
Tags: blogging, containers, docker, openshift
Published: 2018-07-13 19:32:46

---
title: The Ninja Vault, now with previews!
published: true
description: fixed my server setup so that blog previews show up correctly
tags: blogging, containers, docker, openshift
cover_image: https://thepracticaldev.s3.amazonaws.com/i/crywp70j5cwzrli1wkec.png
---

I am a problem solver, so when I saw that previews for my [blog entries](https://vault.osninja.net) weren't showing up correctly in the various social media sites I like to post to, I had to investigate. Turns out my nginx configuration wasn't quite right, and my blog metadata was misconfigured. I learned all about the various tags that social media sites use, and I learned about the tools you can use to check if you are doing it right. Thankfully [Ghost](https://ghost.io) takes care of most of that for me, but you have to check that it is configured correctly. You have to admit, this looks way better:

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

than this:

![](https://thepracticaldev.s3.amazonaws.com/i/0t5fotvxwpfgezbc45yn.png)

If you are interested in learning more, let me know, and I'll write up a little blog entry on it.
Buenas prácticas con Serverless
Tags: serverless
Published: 2018-07-13 18:55:52

---
title: Buenas prácticas con Serverless
published: true
tags: serverless
canonical_url: https://yorodm.github.io/blog/practicas-serverless-framework/
---

# Algunas buenas practicas para Serverless Framework

Aunque llevo poco tiempo utilizando [Serverless](http://serverless.com) he intentado ir escribiendo un conjunto de prácticas para escribir plantillas. Las comparto aquí para los que como yo están empezando.

## Reducir la dependencia de valores externos.

En varios de los ejemplos que he encontrado (incluso en el sitio oficial) es común utilizar referencias a valores externos por toda la plantilla.

```
functions:
  hello:
    name: ${env:FUNC_PREFIX}-hello
    handler: handler.hello
  world:
    name: ${env:FUNC_PREFIX}-world
    handler: handler.world
```

Aunque esto no es una mala practica en si, hace que nuestras funciones dependan de un valor que **solo** vamos a obtener desde el entorno. ¿Qué tal si mañana decidimos que el valor venga [de la salida de otro stack](https://serverless.com/framework/docs/providers/aws/guide/variables#reference-cloudformation-outputs)?

Por suerte para nosotros podemos hacer esto:

```
custom:
    func_prefix: # cualquier fuente para el valor
functions:
    hello:
        name: ${self:custom.func_prefix}
```

De esta manera la dependencia al valor externo ocurre en un solo punto y se propaga hacia el resto de la plantilla.

## Usar plugins.

Las plantillas pueden [utilizar plugins](https://serverless.com/framework/docs/providers/aws/guide/plugins/) que adicionan funcionalidades que van desde nueva sintáxis para algunos aspectos a acceso a características especiales del proveedor que estemos utilizando. Antes de lanzarte a crear un script o [lastimar a una cabra](https://en.wikipedia.org/wiki/Animal_sacrifice) deberías consultar si alguien a[creado un plugin](https://www.npmjs.com/search?q=serverless)

## Contenido en la plantilla según condiciones.

Serverless no tiene soporte para evaluación condicional de plantillas así que si pretendes crear contenido basado por ejemplo en el **stage** del despliegue puedes hacer algo como esto:

```
# stage_properties-qa.yml
functions:
    qa_function:
        handler: MyQaHandler

# stage_properties-prod.yml
functions:
    prod_function:
        handler: MyProdHandler

# serverless.yml
custom:
    stage: ${opt:stage, "qa"}
functions: ${file(stage_properties-${self:custom.stage}.yml):functions}
```

Ahora tienes contenido en `functions` acorde al valor del **stage** si usas varios entornos de configuración esta estructura te puede ahorrar mucho trabajo y posibles complicaciones.

## Otras pistas o trucos.

¿Tienes otras pistas o trucos? Por favor compartelas en los comentarios
Firebase Authentication System in Android Studio
Tags: android, firebase, androidstudio
Published: 2018-07-13 18:35:10

---
title: Firebase Authentication System in Android Studio
published: true
description: This is a series on how to implement firebase authentication system in android studio if you like the series please like it and subscribe my channel

link is given here: https://youtu.be/pnlxh7dsEho

tags: Android,Firebase,Android Studio 
---
WebGL / Canvas Rendering Libraries?
Tags: animation, webgl, canvas, discuss
Published: 2018-07-13 17:05:34

---
title: WebGL / Canvas Rendering Libraries?
published: true
description: Pros and cons of animation libraries
tags: animation, webgl, canvas, discuss
---

I've done a bit of research and the top options seem to be Pixi, Phaser and Canvas (suite of tools). Anyone have experience or advice on any of these? 

I'm inexperienced working with Canvas and WebGL but I'm thinking using a library will save me time and also help me produce a more consistent, high quality result.

Thanks!
Follow Friday! (v5)
Tags: discuss, followfriday
Published: 2018-07-13 17:00:42

---
title: Follow Friday! (v5)
published: true
description: 
tags: discuss, followfriday
---

Below you can either write about **why someone might want to follow you** or **devs you think others should follow and why**. Feel free to do both.

Remember that mutual follows can message/pair via [DEV Connect](https://dev.to/connect), so you're encouraged to follow back and say hey 👋
Published my first ever npm package
Tags: npm, javascript
Published: 2018-07-13 15:42:16

---
title: Published my first ever npm package
published: true
description: A small post about my first ever really published npm package
tags: npm, javascript
---

# I did it!

I am JavaScript developer now for quite a while, but I never managed to create an npm package that made sense to me. In the last days, I helped my girlfriend to prepare for her exam in algorithms and data structures. Within that process, I implemented some sorting algorithm in Java and could not remember that I ever have 
seen a sorting package for NodeJS where I could choose the algorithm.

# So here it is.

[node-sorter](https://www.npmjs.com/package/node-sorter) is my first ever npm package that allows you to sort on arrays and choose the algorithm you want!

Currently, I implemented:
* Bubblesort
* Insertionsort
* Mergesort
* Quicksort
* Heapsort

The source code is available on [GitHub](https://github.com/Neatoro/node-sorter) and mostly tested. I would love hearing some feedback from you. :)
Average daily coding time of a developer
Tags: discuss
Published: 2018-07-13 15:21:28

---
title: Average daily coding time of a developer
published: true
description: 
tags: discuss
---

I know the definition of "coding time" can vary but let's be reasonable and human here, of course coding time is more than the time spent typing actual characters in your editor. Taking a few minutes to read some doc, search the web for a function or to type a few VCS commands count as "coding". On the other hand, spending 30 minutes reading a manual does not. You get the idea.

That being said, let's take a developer working 7 to 8 hours a day (regular day job for example). What would be your estimation of his daily **actual** coding time? On average, of course.

P.S.: This is not a question related to productivity measuring or anything, just plain curiosity.
Upcoming OpenShift Container Security Post
Tags: openshift, docker, containers, security
Published: 2018-07-13 13:56:31

---
title: Upcoming OpenShift Container Security Post
published: true
description: plugging an upcoming blog post about container security
tags: openshift, docker, containers, security
cover_image: https://thepracticaldev.s3.amazonaws.com/i/3rxrg8csc5fbzd64xpik.png
---

I got everything working last night, so next week I should be posting a new deep-dive post on http://tos.ninja about Container Security on [OpenShift](https://openshift.org). I had promised another entry on [s2i](https://github.com/openshift/source-to-image), and that will come soon after. 

Teaser: It involves OpenShift, Jenkins, and Anchore. Tune in next week to read more.
Firebase is AMAZING
Tags: firebase
Published: 2018-07-13 12:42:30

---
title: Firebase is AMAZING
published: true
description: Everybody should try Firebase one
tags: Firebase
---

![image](https://thepracticaldev.s3.amazonaws.com/i/g439nsqwzmf3gatmgxza.png)

I'm using Firebase these days, and I found it very easy to make native apps without coding server side. Firebase gives functions of authentication, analytics, push notifications, database, file storage, etc to developers. Besides, interestingly, the structure of Firestore/Realtime Database is not supposed to be ordinary, it's quite characteristic. Database schema should represent view itself, so normalization is not always good in Firebase. That's so oriented to native app developer.

I made a sample app using Firebase(Firestore, Cloud Messaging, Authentication) like following movie. When a user pushes `Add Button` , a new document will be saved in Firestore, and then this update triggers sending push notifications to this user.

![img](https://thepracticaldev.s3.amazonaws.com/i/j2hnmhx5agxnze7ddc4r.gif)


Source code is in this repository.

https://github.com/ngo275/FirebaseSample

https://github.com/ngo275/FirebaseSampleFunctions
What are good ways to learn software architecture and systems design?
Tags: advice, discuss, architecture, reading
Published: 2018-07-13 12:13:49

---
title: What are good ways to learn software architecture and systems design?
published: true
description: 
tags: advice, discuss, architecture, reading
---

I get anxious when working on back-end code. Data loss, security breaches and scalability/performance issues seem to be lurking around every corner if I don't pay attention. Sure, I can come up with a solution to most problems thrown my way, but with every design choice there's always the thought that maybe I didn't think it through and I forgot about a critical part of the system and it will have serious ramifications in the future.

This feeling is not only at my day job where I work on a fairly complex Rails app, but also in my hobby of game design and development — sketching out ideas and hacking together a prototype is one thing, but building it so that the code is maintainable, scalable, secure and easily understood from the start feels like black magic.

Of course, architecture and design patterns are not only a back-end thing. I've learned to write more or less maintainable code over the years and always seek ways to make it more flexible and concise, but the end result is just cosmetics anyway and the real magic happens elsewhere, so it doesn't feel as important.

Aside from just reading and understanding the source code I'm working on and familiarizing myself with source code of other, open-source applications, what are other good ways to learn the "correct mindset" of building systems? I'm most interested in how to think about the system as a whole and how to divide it into parts that make the most sense, given the overall problem the system is trying to solve; How to think about data flow, single responsibility, patterns that can be applied etc. How and where should I even begin?

![I have no idea what I'm doing](https://media.giphy.com/media/xDQ3Oql1BN54c/giphy.gif)
PHP: Testing only changes
Tags: phpunit, changes, testing, composer
Published: 2018-07-13 09:21:03

---
title: PHP: Testing only changes
published: true
description: A way to test only files that have been modified since the last commit
tags: phpunit, changes, testing, composer
---

![changes](https://mausatf.com/wp-content/uploads/2015/05/change_sign1.jpg)
<center><small><u>Ref: [USATF Mid-Atlantic](https://mausatf.com/background-screening-process-changes/)</u></small></center>

I recently found [this awesome 😍 tool](https://github.com/IcyApril/WhatsChanged) that let me run tests on only files that have been modified since the last commit, like I'm familiar with in [the Jest framework](https://jestjs.io).

Because I couldn't find a way to do this with [PHPUnit Watcher](https://github.com/spatie/phpunit-watcher) or PHPUnit itself, and it worked for me with a few minor blocks, I have decided to share. 

> If you know how, please tell me in the comments.

### The Blocker

The package's PHPUnit dependency was marked as `^6.0`, so it wasn't working on my project, which had a dependency marked as `^7.0`.

### The Fix

I've made a fork [here](https://github.com/mykeels/WhatsChanged) and I use its `dev-master` branch in my project by adding it to `composer.json` like:

```json

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/mykeels/WhatsChanged"
    }
],
"require-dev": {
    "icyapril/whats-changed": "dev-master"
}
```

This is so that composer [resolves the package from my GitHub fork](https://stackoverflow.com/a/13500676/7396801) rather than use the official package. 

### Usage

Now, when run `./vendor/bin/whatschanged`, I get:

```bash
tests/Feature/AuthTest.php     OK (3 tests, 6 assertions)
tests/Feature/IntentTest.php   OK (5 tests, 21 assertions)
```

rather than

![image](https://user-images.githubusercontent.com/11996508/42683545-85d8f218-8685-11e8-8762-82ec753a8497.png)

🎉💃 Happy Coding!
Stop expecting tools, start expecting understanding
Tags: jobs, jobspecs, react, javascript
Published: 2018-07-13 07:50:00

---
title: Stop expecting tools, start expecting understanding
published: true
description: Take a look at your junior job specs
tags: Jobs, Job specs, React, JavaScript
---

In my role at [Mayden Academy](https://maydenacademy.co.uk), I speak to a lot of companies about their needs for new developer staff. With the current big trend towards front-end applications and JavaScript frameworks, I’m seeing that companies are increasingly making skills with specific frameworks a requirement within their job ads. I will always, always advise against that.

Here’s why.

A developer with an understanding of vanilla JavaScript – who has dabbled with a few of the most popular JavaScript libraries and frameworks – will be able to pick up new frameworks and libraries with ease.

Companies expecting years of experience with React / Angular / [insert your favourite framework here] are entirely missing the point. Would you rather hire a developer who can only write React, or someone with a real depth of understanding of JavaScript who can pick up any framework?

Unfortunately there are far too many developers in the industry today who were ‘brought up’ on a particular tool or framework, rather than understanding the fundamentals of a language before picking up its tools. As an industry we need to start encouraging training organisations to focus on vanilla languages when teaching beginners, not on shiny new tools.

At [Mayden Academy](https://maydenacademy.co.uk) we’re determined to ensure that our graduates are set up for long term careers, not for skills that will plug short term gaps in the job market for now. Sure, we teach tools and frameworks too, but we don’t touch them until our students have a solid understanding of the technologies behind them.

Hiring people who have experience in specific tools / frameworks is no a bad thing. But don’t make it a requirement for your junior level positions. If you’re making specific tools / frameworks a requirement for a junior position, I’d suggest you take a good look at the position you are trying to fill. Is it really a junior developer you need?

Invest in junior developers by recruiting people who understand vanilla technologies, and then teaching them your particular toolset. My guess is that this will vastly increase your potential hiring pool.
Add versioning to an Asp.Net Core Web API
Tags: aspnetcore, c, versioning, webapi
Published: 2021-03-03 20:37:43

---
title: Add versioning to an Asp.Net Core Web API
published: true
date: 2018-07-13 05:11:40 UTC
tags: AspNetCore,C,Versioning,WebAPI
canonical_url: 
---

There are occasions you would like or need to add versioning to your API in order to specify availability or non-availability of functionality.

There are a few options available such as Query String, Url based as well as Http header.

For my purposes I am going to talk about the Url based approach, as I have implemented this option in my [MyReverie](https://github.com/andrewcahill/MyReverie) repo due to a matter of preference of being cleaner and more explicit.

First things first we will need to go ahead and install the Nuget package:

- **Microsoft.AspNetCore.Mvc.Versioning**

Within the Startup class ConfigureServices method add the below:

```
services.AddApiVersioning(v =>
{
    v.ReportApiVersions = true;
    v.AssumeDefaultVersionWhenUnspecified = true;
    v.DefaultApiVersion = new ApiVersion(1, 0);
});
```

The above three properties are particularly useful in that they allow default versions to be set if none are explicitly set as well as providing header information on versioning that are supported.

**ReportApiVersions** : we are requesting the header to respond with supported API versions

**AssumeDefaultVersionWhenUnspecified** : set the default version if none are explicitly requested

**DefaultApiVersion** : Set the default version to 1.0 if default is used

To better illustrate the first property above see below. I used Postman to see the response header with supported versions listed, which I highlighted

[![Versioning_thumb7](https://aviddeveloper.com/wp-content/uploads/2018/07/Versioning_thumb7_thumb.png "Versioning\_thumb7")](https://aviddeveloper.com/wp-content/uploads/2018/07/Versioning_thumb7.png)

Now all I have to do is simply add and update the controller attribute in my case

At the moment as I am still on version 1, I will add the attribute

```
[ApiVersion("1.0")]
```

and update the route attribute like so:

```
[Route("api/{v:apiVersion}/[controller]")]
```

So the result of the Controller class(GoalsController in my case) attributes should look like the below

[![Versioning_thumb1](https://aviddeveloper.com/wp-content/uploads/2018/07/Versioning_thumb1_thumb.png "Versioning\_thumb1")](https://aviddeveloper.com/wp-content/uploads/2018/07/Versioning_thumb1.png)

Now let’s test our F5 and browse to our API endpoint with suffix : /api/1.0/goals, in my case below.

[![Versioning_thumb3](https://aviddeveloper.com/wp-content/uploads/2018/07/Versioning_thumb3_thumb.png "Versioning\_thumb3")](https://aviddeveloper.com/wp-content/uploads/2018/07/Versioning_thumb3.png)

That’s it my API is now versioned v1.0

The post [Add versioning to an Asp.Net Core Web API](https://aviddeveloper.com/versioning-asp-net-core-web-api/) appeared first on [Avid Developer](https://aviddeveloper.com).
Else clause for Python's for loop
Tags: python, beginners
Published: 2018-07-13 01:57:33

---
title: Else clause for Python's for loop
published: true
description: 
tags: python, beginners
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vu8zuc50t8u4gj9b9npf.jpg
---
*Photo by [Kelly Sikkema](https://unsplash.com/@kellysikkema) on [Unsplash](https://unsplash.com)*

Not everyone knows, but there is an "else" clause for For loops.
I often see this:

```python
did_something = False
for element in elements:
    if element.something:
        do_something()
        did_something = True
        break

if not did_something:
    do_something_else()
```

But it should be like this:
```python
for element in elements:
    if element.something:
        do_something()
        break
else:
    do_something_else()
```

Else clause executes only if the for loop exits naturally, without any break statements. That simple.
What Do You Look For in a Mentor?
Tags: javascript, discuss, frontend, mentorship
Published: 2018-07-13 01:35:14

---
title: What Do You Look For in a Mentor?
published: true
description: A discussion around empathetic & helpful tactics for teaching brand new developers
tags: javascript, discuss, frontend, mentorship
---

Front end engineer here, looking to make a positive impact on the growth of new devs 💪

When you first started your programming journey — what are some of the concepts/workflows/teaching techniques that your first mentors really knocked out of the park, and why? 

If your experiences haven't been super positive, what would make the learning process easier and more enjoyable for you? What would you change about the industry to make it less intimidating and more empathetic?

Let's hear it in the comments!
Don’t worry! It’s all about enjoying the journey of life!
Tags: journey, lifelessons
Published: 2019-08-21 11:01:07

---
title: Don’t worry! It’s all about enjoying the journey of life!
published: true
tags: journey,life-lessons
canonical_url: 
---

Life is not about reaching goals, because when we reach those goals we will have other goals to reach.

No!

Life is about having a journey with things you will experience, some are great and some are not so great!

Things happen for a reason in life, even when you can’t see the reason at that point in life, later you will definitlly understand it!

So be more focussed on enjoying the journey towards goals, than reaching a goal itself!

Enjoy the ride called life!

Don’t make your life so difficult for yourself by only doubting which thing you should do next!

Don’t overthink your life but live the life by making a choice, stick to it, fail and try again!

Nobody will live a perfect life!

We are human, we are designed to make choice and to enjoy life!

If your doubting to much right now? Than imagine driving on a road with 2 posibilities. You can go left or right, you never will know the outcome until you take action and drive left or right!

It can be a good choice, it can be a bad. If it is a bad one, SO WHAT! Use that as a new starting point, make it a lesson and base your choices on it next time!

Don’t be affraid to walk on the road called life! Don’t fear failure! Embrace it as life lessons!

This the positive message I wanted to share with you today! Make every minute count!

See next time! Peace ✌️
Building An Audio Player App with Ionic, Angular, RxJS, and NgRx
Tags: angular, ionic, rxjs, ngrx
Published: 2018-07-12 20:17:16

---
title: Building An Audio Player App with Ionic, Angular, RxJS, and NgRx
published: true
description: Learn how to develop modern mobile apps with Angular, Ionic, RxJS and NgRx. Follow this tutorial to create a mobile audio player app.
tags: #angular #ionic #rxjs #ngrx
canonical_url: https://auth0.com/blog/building-an-audio-player-app-with-ionic-angular-rxjs-and-ngrx/
---

In this article, you will learn how to develop a mobile audio player app using Ionic framework and Angular. You will handle audio operations using RxJS and Observables, and you will also explore how you can manage application's state with NgRx.

[Read on 📱🔊💃](https://auth0.com/blog/building-an-audio-player-app-with-ionic-angular-rxjs-and-ngrx/?utm_source=dev&utm_medium=sc&utm_campaign=ionic_angular)

![Building An Audio Player App with Ionic, Angular, RxJS, and NgRx](https://thepracticaldev.s3.amazonaws.com/i/jmw3xmdnvwpb51a62osb.png)
Explain Managing Projects Like I'm Five
Tags: explainlikeimfive, beginners
Published: 2018-07-12 19:59:50

---
title: Explain Managing Projects Like I'm Five
published: true
tags: explainlikeimfive, beginner
---

I was thinking about it today and I realized I don't know what the best practices are when it comes to managing projects. By that I mean, managing versions of Python for `Project A` and `Project B`; or whatever tool you use where versions may differ between projects.

There's a 50% chance 'Managing Projects' is the wrong title for this ELI5. I'm just wondering what are the best ways to sandbox projects or if sandboxing projects is a good practice at all in the first place.