teleren/devto huggingface dataset:
I made a book ranking site based on Reddit discussion
Tags: books, vue, mongodb, graphql
Published: 2019-09-08 18:01:27

Hi everyone,

Reddit is a great place to find honest book reviews. I love to spend time reading through recommendations and book club discussions. However sometimes searching through hundreds of posts and sub-reddits can get quite hectic. 

So I decided to automate this process. [Top Trend Books](https://toptrendbooks.com/) scans +100,000 Reddit posts and comments everyday to aggregate over 15,000 books. Each book is tagged, categorized, and ranked to enhance discovery. 

Ranking system is based on up-votes, total references, and date of reference. Each Reddit reference's user ID is tracked to prevent self-promoting. Date base filter is extremely useful allowing Week, Month, Year, All range search.

It would be super exciting if you find a cool book that fits you. Also I would really appreciate if you could share your feedback and improvement thoughts :)

📚 **Recommended Collections** 📖

**[Weekly Top10 Blog](https://toptrendbooks.com/blog)**
**[LearnProgramming](https://toptrendbooks.com/all/learnprogramming/tag/)**
**[AudioBooks](https://toptrendbooks.com/all/audiobooks/tag/)**
**[FreeEBooks](https://toptrendbooks.com/all/FreeEBOOKS/tag/)**
**[IfYouLikeBlank](https://toptrendbooks.com/all/ifyoulikeblank/tag/)**
**[Futurology](https://toptrendbooks.com/all/Futurology/tag/)**
**[WroteABook](https://toptrendbooks.com/all/wroteabook/tag/)**
**[All Sub-Reddit Tags](https://toptrendbooks.com/tags)**
**[Top 100 Trend Book Newsletter](https://toptrendbooks.com/newsletter)**

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3gfnasdxl9bvr4zrf4k6.png)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/iphlh6wo63tm5ko0upx0.png)
Write your dev blocks quickly using this editor.
Tags: javascript, frontend, react, productivity
Published: 2019-09-08 17:40:43

---
title: Write your dev blocks quickly using this editor.
published: true
description: This editor helps you to write dev blogs quickly.
tags: javascript, frontend, react, productivity
---

# Hi all, I am super excited you tell you that now you can write down dev blogs quickly using [dev-editor](https://deveditor.dev). Here is how
# 
# 
{% youtube L2jaQWOiJmA %} 

_P.S: This blog is created using dev-editor._

**Feedback and Contributions are most welcome. Fork it here **

[https://github.com/saravanan10393/dev-editor](https://github.com/saravanan10393/dev-editor)
StrictMode no Android: Porquê, quando e como utilizar
Tags: android, stictmode
Published: 2019-09-08 17:25:43

(Artigo movido da minha conta no Medium)

Já pensou em alguma ferramenta que serve de seu guardião? Que vai te alertando
quando você fizer algo de errado por acidente? Então conheça o StrictMode.

**StrictMode** é uma ferramenta que detecta certas coisa que você pode estar a
fazer por acidente, e te alerta sobre estas falhas para que você resolva tais
falhas.

O StrictMode é mais usado para detectar acesso à base de dados ou acesso à rede
na Thread principal do aplicativo.

**ATENÇÃO:** O StrictMode deve ser usado somente em tempo de desenvolvimento.

### Como usar?

Para habilitar e activar o StrictMode devemos executar o seguinte código no
**onCreate()** da sua actividade ou da classe application:

```kotlin
public void onCreate() {
     super.onCreate();
  
     if (DEVELOPER_MODE) {
         StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                 .detectDiskReads()
                 .detectDiskWrites()
                 .detectNetwork()   // ou .detectAll()
                 .penaltyLog()
                 .build());
         StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                 .detectLeakedSqlLiteObjects()
                 .detectLeakedClosableObjects()
                 .penaltyLog()
                 .penaltyDeath()
                 .build());
     }
 }
```

Abaixo a descrição de alguns dos métodos usados acima:

#### ThreadPolicy

Usado para detectar violações de execução de tarefas na Thread principal do
aplicativo.

**detectDiskWrites()/detectDiskReads()** Captura violações de escrita e leitura
na thread principal do interface do usuário.

**detectAll()** Usado para capturar todas as violações de Threads do aplicativo.

#### VmPolicy

Usado para aplicar politicas em todas as Threads da máquina virtual.

* **detectLeakedSqliteObjects()**
Detecta quando um cursor SQLite é terminado sem
ter se fechado.
* **detectLeakedClosableObjects()**
Detectar quando um objeto com um método de
terminação explícita for finalizado sem ter sido fechado.
* **detectAll()**
Usado para capturar todas as violações de Threads do aplicativo.

### Penalidades Aplicadas

Você é quem decide o que deve acontecer quando uma violação é detectada,
chamando uma das seguintes funções:

* **penaltyLog()**
Apresenta as violações na janela de LogCat do Android
Studio, conforme eles vão aparecendo.
* **penaltyDialog()**
Mostra uma caixa de dialogo na tela sempre que uma violação
for detectada.
* **penaltyDeath()**
Mata o processo da aplicação onde o StrictMode foi activado.

### Nota:

Não se sinta obrigado a corrigir tudo o que StrictMode encontrar, muitos casos
de acesso a dados são geralmente necessários durante o ciclo de vida normal da
atividade.

Use StrictMode para encontrar coisas que você fez por acaso. Acesso a rede na
Thread principal são quase sempre um problema, nestes casos você deve arranjar
um jeito de os tratar.

#### **Dica:**

Use sempre o StrictMode em seus projetos, ele melhora consideravelmente a
performance a de seu aplicativo, ajudando a detectar problemas e falhas no
projecto.
Analog Clock - Pure CSS
Tags: codepen
Published: 2019-09-08 17:14:08

<p>A simple analog clock made with pure CSS. No scripts. No images. No SVG.</p>

<p>Design =&gt; <a href="https://dribbble.com/shots/6118476-Did-You/" target="_blank">https://dribbble.com/shots/6118476-Did-You/</a></p>

{% codepen https://codepen.io/JavaScriptJunkie/pen/gOYvPMv %}
Enterprise BYOD: Who Is In Control?
Tags: byod, enterprise, business
Published: 2019-09-08 17:03:49

Many business leaders view the push for a “Bring-Your-Own-Device” (BYOD https://cllax.com/top-10-best-byod-mobile-device-management-software.html) model as a sign that businesses just need to start providing their employees with trendier, more mobile devices to appease their users and “catch up” with the consumer market. However, many of these users already own and use smartphones, tablets, and laptops on regular basis. Users are not asking businesses to provide them with additional devices, they’re simply asking for the ability to use their own.

So why haven’t we seen businesses open their networks and grant their users access to the data and services they need? Why are we still talking about the struggles of BYOD and saying no to our users?

The answer is twofold and is rooted in the fact that both parties are reluctant to give up control.

Businesses do not want to start relinquishing their ability to lockdown corporate devices, pick and choose when and how employees can work, and always having logs of what workers are doing. Employees, on the other hand, want to be able to choose whichever device they want, irrespective of security and management feature sets and are unwilling to sign their personal devices over to the remote-wipe capabilities of their company’s whimsical IT system administrator. Both parties need to consider each side’s perspective in order to make a successful BYOD model a reality.

The missing piece to this discussion is the role of the vendors when it comes to BYOD. Before businesses can truly embrace BYOD, vendors need to start designing solutions differently than they have been. These changes include releasing consumer-level devices with more manageability, security, and features that give users more control over the “personal” parts of their device without sacrificing the integrity of the “corporate” areas. We are already beginning to see this play out in newly announced product road maps related to Android, iOS, and Windows software and devices.

From the enterprise services perspective, vendors need to begin designing creative solutions to accessing applications without relying on specific device configurations or software. We are seeing this already as well with the increase in Software-as-a-Service platforms and “Private Cloud” functionality allowing users to access services through the web with little more than a standard browser. With this level of service in place, businesses are able to leverage intelligent, secure solutions to help grant access to these private, web-based services to users both inside and outside their campus networks.

With solid, accessible, and secure service infrastructures in place on the back end and modern, user-specific devices in users’ hands, a successful BYOD model in the enterprise is finally within reach.
Microservice Architecture in a Nutshell
Tags: softwaredevelopment, architecture, microservices, agile
Published: 2019-09-08 16:57:28



We have been building applications and getting better at it for years and a variety of technologies, architectural patterns, and best practices have been developed along this period. Microservices is an architectural pattern that has emerged during those years, especially because of containers. Docker is the main actor of all these changes because it has popularized containers and helped us containerizing our applications.


## Concept

Microservice architecture is a variant of the service-oriented architecture that organizes an application as a collection of loosely coupled services. These services are responsible for specific tasks and can communicate with each other through simple APIs to solve a larger complex business issue. Summarizing, microservices are a particular technique for developing software systems that attempt to concentrate on structuring single-function modules with well-defined interfaces and operations.

![microservices](https://thepracticaldev.s3.amazonaws.com/i/mk9gr3ffvx4gpzvz0u2g.jpg)


## Pros & Cons

Microservices are used to speed up development, feature release, ease scalability; they offer improved fault isolation, etc. If you are developing an application and it has to support a variety of different clients including desktop, mobile browsers, and native mobile applications, you must consider implementing your application using microservice architecture.

Microservices also bring complexity to network, testing, deploying, monitoring, etc. Team communication can be hard without using automation and Agile methodology. You also might have to introduce CI/CD tool, configuration management, and application-deployment tool, service mesh, and API gateway to help you with testing, building, shipping, discovering and connecting all services.


## Conclusion

Along all these years we have improved the way we develop systems and we’ll keep doing it. If you automate and do everything in the right way, you probably won’t face issues and will love microservices. All software architectural patterns and styles have their pros and cons and microservices architecture isn’t different but it helps us to be more agile.
Dynamically set default queryParams in ember > v3.6.x
Tags: ember, javascript
Published: 2019-09-08 16:55:58

Imagine you have an app with following route:

```
https://example.com/calendar
```

This route can accept optional *queryParams* `from` and `to` that will determine what part of the *calendar* should be displayed:

```
https://example.com/calendar?from=2019-09-01&to=2019-09-08
```

And now imagine that there is a requirement to let the users access the *bare URL* and display *current week*.

One option would be to check whether `from` and `to` are set, and if not fill those with respective values somewhere **inside** the code logic.

I am a firm believer of deriving as much *state of the app* as possible from the *URL*. So I would suggest: Check whether `from` and `to` are set, and if not redirect the app to *URL* with those *queryParams* set to respective values. Or in other words: Deriving the state from the **outside**.

My main reasons on why this is a good idea are:

 - The URL can be bookmarked & shared and every user will see **the same** data.
 - We have to set the *queryParams* on **one place** and every part of the app can to read the values from that place.

I had the redirect approach implemented in my app:

```js
// COMPATIBLE WITH ember v3.4.3

import Route from "@ember/routing/route";
import moment from "moment";

export default Route.extend({
  queryParams: {
    from: { refreshModel: true },
    to: { refreshModel: true },
  },

  beforeModel(transition) {
    let params = transition.queryParams;
    if (!params.from || !params.to) {
      this.replaceWith({
        queryParams: {
          from: moment()
            .startOf("week")
            .format(dateFormat),
          to: moment()
            .endOf("week")
            .format(dateFormat)
        }
      });
    }
  },
});
```

This stopped working for me while doing an upgrade to **ember v3.12.0**. Digging through the changelog and [pull requests](https://github.com/emberjs/ember.js/commit/d4d86e178e1df64dc9f4d14d0112bf7a5e3e4dfc) I found out that in **ember v3.6.x** new `RouteInfo` objects `from` and `to` [has been added](http://api.emberjs.com/ember/3.12/classes/Transition/properties/from?anchor=from).

So I made respective changes and now the code looks like:

```js
// COMPATIBLE WITH ember > v3.6.x

import Route from "@ember/routing/route";
import moment from "moment";

export default Route.extend({
  queryParams: {
    from: { refreshModel: true },
    to: { refreshModel: true },
  },

  beforeModel(transition) {
    let params = transition.to.queryParams; // << This line has changed
    if (!params.from || !params.to) {
      this.replaceWith({
        queryParams: {
          from: moment()
            .startOf("week")
            .format(dateFormat),
          to: moment()
            .endOf("week")
            .format(dateFormat)
        }
      });
    }
  },
});
```

From the wording in the PR I came to a conclusion that I was using a private API of the `transition` object, which is never a good idea.

-----

Cover photo from [Diomari Madulara](https://unsplash.com/@diomari) on [unsplash](https://unsplash.com).
A Caching Library, written in Swift that can cache Anything.
Tags: swift, ios, cache
Published: 2019-09-08 16:55:11

---
title: A Caching Library, written in Swift that can cache Anything.
published: true
description: A Caching Library, written in Swift that can cache JSON, Image, Zip or anything with expiry date and force refresh.
tags: swift,ios,cache
---

Needed a cache Library that has

- [x] Asynchronous data downloading and caching.
- [x] Asynchronous image downloading, caching and showing.
- [x] Expiry date/time for all the objects individually.
- [x] Multiple-layer hybrid cache for both memory and disk.
- [x] Fine control on cache behavior. Customizable expiration date and size limit.
- [x] Force refresh if needed.
- [x] Independent components. Use the [Cachy](https://github.com/Sadmansamee/CachyKit) or [CachyLoader](https://github.com/Sadmansamee/CachyKit) system separately as you need.
- [x] Can save JSON, UIImage, ZIP or anything.
- [x] View extensions for `UIImageView`.
- [x] Indicator while loading images.

Couldn't find any all in one solution, either it's too much or too less, so came up with this.

https://github.com/Sadmansamee/CachyKit

it's the first version there might be a lot of issues or bad, please point them out and how I can improve them.
Microservice Architecture in a Nutshell
Tags: architecture, softwaredevelopment, agile, microservices
Published: 2022-12-27 16:51:05

---
title: Microservice Architecture in a Nutshell
published: true
tags: softwarearchitecture,softwaredevelopment,agile,microservices
canonical_url: https://medium.com/buildly/microservice-architecture-in-a-nutshell-3e2c84189fcd
---

Our team at Buildly have been building applications and getting better at it, most of the time, for years. We have worked with a variety of technologies, architectural patterns, and best practices have been developed along this period. Microservices is an architectural pattern that has emerged during those years, especially because of containers. Docker is the main actor of all these changes because it has popularized containers and helped us containerizing our applications.  I thought I might revisit the core concepts of it and the primary pattern and concept we like the most.

### Concept

Microservice architecture is a variant of the service-oriented architecture that organizes an application as a collection of loosely coupled services. These services are responsible for specific tasks and can communicate with each other through simple APIs to solve a larger complex business issue. Summarizing, microservices are a particular technique for developing software systems that attempts to concentrate on structuring single-function modules with well-defined interfaces and operations.

![](https://cdn-images-1.medium.com/max/945/0*8V0XNeZ0Ld3dyDLX.jpg)

### Pros & Cons

Microservices are used to speed up development, feature release, ease scalability; they offer improved fault isolation, etc. If you are developing an application and it has to support a variety of different clients including desktop, mobile browsers and native mobile applications, you must consider implementing your application using microservice architecture.

Microservices also bring complexity to network, testing, deploying, monitoring, etc. Team communication can be hard without using automation and Agile methodology. You also might have to introduce CI/CD tool, configuration management, and application-deployment tool, service mesh, and API gateway to help you with testing, building, shipping, discovering and connecting all services.

### Conclusion

Along all these years we have improved the way we develop systems and we’ll keep doing it. If you automate and do everything in the right way, you probably won’t face issues and will love microservices. All software architectural patterns and styles have their pros and cons and microservices architecture isn’t different but it helps us to be more agile.

* * *
Getting out of my comfort zone
Tags: beginners, productivity, career
Published: 2019-09-08 16:40:09

I recently deployed [my site](https://tngeene.com/) to the web. It's always been a dream of mine to have my own little corner of the web, where I could put myself out there, beyond the confines of home and country...to the world. To be a creator rather than just a consumer. However, when a goal seems too far away and we can't envision a clear path to reach it, we always reach for the same drawer:
![Excuses](https://thepracticaldev.s3.amazonaws.com/i/hlfn6yd28wh8i6kaqqp2.jpg)


I seemed to be having a lot of those, real or imagined (mostly imagined) so I put off the project for the better part of the year. Perhaps the fear of the internet and the response I would get played a big role in my procrastination. 
All that aside I've decided to launch this site with the intention of:
putting myself out there 
to actively create content about what I enjoy doing, programming and talk about technology...how we can use it as a tool to serve us and not replace human relationships
I'm no expert, by any means but I do hope to inspire, most, if not all of the people that will engage with my content.
If you happen to come across any of my articles, I'll appreciate the feedback, both positive and critical. 
 
Godspeed.
Am I the Live Jenkins Host?
Tags: bash, devops, linux
Published: 2019-09-08 16:05:51

I prefer using a centralized Jenkins in place of host specific crontabs; it's much more visible and you just can't beat the price. To enhance survivability I like keeping a few instances running in parallel and fronted by HAproxy, but this presented a problem when I had scheduled jobs that could only safely run once. 

A little prodding with `curl -I` shows that Jenkins instances return a hashed identity value in their response header which we can use to earmark specific instances; the below chunk will silently abort any shell script it is added-to if that script is being called from a "hot spare" Jenkins instance. 

```bash
#!/bin/bash

LIVE=$(https_proxy="" curl -I -s -u $USERNAME:$PASSWORD https://$JENKINS_URL:8080 | awk '/X-Instance-Identity/ { print $2 }')
IAM=$(https_proxy="" curl -I -s -u $USERNAME:$PASSWORD http://127.0.0.1:8080 | awk '/X-Instance-Identity/ { print $2 }')

[[ "$LIVE" == "$IAM" ]] || exit 0
```

<br><br><br>

{% gist https://gist.github.com/lbonanomi/ce79546ea593240bc1c6cc2ca66a5968 %}
Backup and Restore NiFi Registry Templates
Published: 2019-12-03 21:50:47

---
title: Backup and Restore NiFi Registry Templates
published: true
date: 2019-09-08 14:43:00 UTC
tags: 
canonical_url: 
---

### Backup and Restore NiFi Registry Templates

[![](https://1.bp.blogspot.com/-No9qw2C_Ygg/XXUTR1AkewI/AAAAAAAAYWE/yJlNYWmB-5QaWrj7tuBnUJLrNRikGTWNgCLcBGAs/s640/NiFiFlow1.png)](https://1.bp.blogspot.com/-No9qw2C_Ygg/XXUTR1AkewI/AAAAAAAAYWE/yJlNYWmB-5QaWrj7tuBnUJLrNRikGTWNgCLcBGAs/s1600/NiFiFlow1.png)
  

[![](https://1.bp.blogspot.com/-6Oaj9sfX_e4/XXUTR_p6lvI/AAAAAAAAYWA/FbHCfvrK2GwOQ-4HzRv7UHESNZ9t9msPQCLcBGAs/s640/nifiFlow2.png)](https://1.bp.blogspot.com/-6Oaj9sfX_e4/XXUTR_p6lvI/AAAAAAAAYWA/FbHCfvrK2GwOQ-4HzRv7UHESNZ9t9msPQCLcBGAs/s1600/nifiFlow2.png)
  

[![](https://1.bp.blogspot.com/-H7_or27_JcM/XXUTRyxmckI/AAAAAAAAYV8/Li5Ou9Bz_aEgFxVGpiQpO0ayB33vc6Z1QCLcBGAs/s640/NiFiFlowOverview.png)](https://1.bp.blogspot.com/-H7_or27_JcM/XXUTRyxmckI/AAAAAAAAYV8/Li5Ou9Bz_aEgFxVGpiQpO0ayB33vc6Z1QCLcBGAs/s1600/NiFiFlowOverview.png)

#### 

#### Example Backed Up NiFi Flow Excerpt

> {  
>   "bucket" : {  
>     "createdTimestamp" : 1566430253392,  
>     "identifier" : "aaa50be8-b994-46b5-a0bb-be245c34b928",  
>     "link" : {  
>       "href" : "buckets/aaa50be8-b994-46b5-a0bb-be245c34b928",  
>       "params" : {  
>         "rel" : "self"  
>       }  
>     },  
>     "name" : "IoT",  
>     "permissions" : {  
>       "canDelete" : true,  
>       "canRead" : true,  
>       "canWrite" : true  
>     }  
>   },  
>   "flow" : {  
>     "bucketIdentifier" : "aaa50be8-b994-46b5-a0bb-be245c34b928",  
>     "bucketName" : "IoT",  
>     "createdTimestamp" : 1566430269976,  
>     "description" : "Created by MiNiFi C2 Flow Designer",  
>     "identifier" : "56902ff0-62ac-4189-9684-765247c885b5",  
>     "link" : {  
>       "href" : "buckets/aaa50be8-b994-46b5-a0bb-be245c34b928/flows/56902ff0-62ac-4189-9684-765247c885b5",  
>       "params" : {  
>         "rel" : "self"  
>       }  
>     },  
>     "modifiedTimestamp" : 1567693783102,  
>     "name" : "raspianjava",  
>     "type" : "Flow",  
>     "versionCount" : 10

  

#### Restoring Backed Up NiFi Flows
  
[http://nifi.apache.org/docs/nifi-registry-docs/rest-api/index.html](http://nifi.apache.org/docs/nifi-registry-docs/rest-api/index.html)  
  
To restore an Apache NiFi registry flow file.  
  
**Create a flow**  
  

POST

/buckets/{bucketId}/flows

Creates a flow

  
  
Using bucket id, upload a flow via POST and get a new flow id  
  
Create a version of a flow  
  
POST with that bucket id and flow id  
  

/buckets/{bucketId}/flows/{flowId}/versions

Creates the next version of a flow

  

#### Scripted NiFi Registry Backups for DevOps Processing
  
You can also backup and restore NiFi Registry using the NiFi Python API or REST API directly.  
  
  

- [https://github.com/tspannhw/BackupRegistry](https://github.com/tspannhw/BackupRegistry) 
- [https://nipyapi.readthedocs.io/en/latest/](https://www.blogger.com/%C2%A0https://nipyapi.readthedocs.io/en/latest/)