teleren/devto huggingface dataset:
Intermediate library providing CRUD functionality: Related Work
Tags: help, designpattern, react, crud
Published: 2019-07-13 13:10:45

I am currently planning to create a library (I call it CRUD Library) that serves as an intermediate layer for a developer between his own code and the external UI/data-presentation library. The external library could be for example a library that displays lists or let the users manipulate lists (delete entries, sort, search etc). My plan is to create this intermediate layer that encapsulates the 3rd party library details and only exposes a simpler to use “CRUD” layer for most common use cases to speed up the development for most scenarios. I created a drawing to explain the idea in more detail:

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


The developer would this way be able to check if one of the templates provided already fit his user story (this would be User story 1 in the image) or if he would implement the outermost layer himself and use the CRUD layer (User story 2 in the image) or if his use case is so specific that he still needs to talk to the 3rd party library manually. 

The idea is to find a few generic data manipulation patterns (that's why I want to call it CRUD library) that can be reused on any 3rd party library, so no matter how the 3rd party library defines its own interface I would want to expose a CRUD interface on top that the developer is already used to go use it instead. Similar to an Adapter pattern but on a library pattern level. 

The template layer on top of the CRUD layer is an additional extension of the idea and it would, of course, be different for each 3rd party library but I want to research if also there I can find common patterns for very different libraries and target data structures. 

My question is if anybody knows any existing projects or research in such a direction or has any other insights they might want to share, I am open to any feedback or critic, thanks!
A few JavaScript puzzlers
Tags: javascript
Published: 2019-07-13 13:02:13

*Cover photo by Kyle Glenn on Unsplash.*

### Good morning! 🌥️ How's your weekend going?

I've been sick lately, so haven't had a lot of energy to work on the usual posts. But I've put together a few quick "riddles" specific to JavaScript.

If you get the answers early on, try to not spoil the answers in the comments for those just looking for hints rather than solutions. (Spoiler tags when?)

## #1 - Non-reflexive

This one is fairly simple if you know the language "gotchas", but quite a puzzle indeed if you've never seen this behavior before.

```javascript
x === x; // true
x[+[]] === x[+[]]; // false
```

There is more than one answer, see if you can find the whole solution space for an additional challenge.

Hint links:

* [StackOverflow](https://stackoverflow.com/questions/4170978/explain-why-this-works)
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
* [Blog post](http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html)

## #2 - Reciprocal

Here's another head scratcher:

```javascript
x === y; // true
1/x === 1/y; // false
```

Find values of x & y.

The senior JS devs are groaning and probably already know the answer. But for those of you less practiced, here is a hint:

* [ECMAScript specification](https://www.ecma-international.org/ecma-262/5.1/#sec-8.5)

## #3 - Prototype

And another one:

```javascript
var someone = function() {};
someone.prototype.attributes = {};

var alice = new someone();
alice.attributes.name = 'Alice';

var bob = new someone();
bob.attributes.name = 'Bob';

var eve = new someone();
```

At the end of this code, what is `eve.attributes.name`?

Your hints are:

* [Medium](https://medium.com/launch-school/javascript-weekly-data-types-and-mutability-e41ab37f2f95)
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new)

---

JavaScript really is quite a puzzling language, isn't it? Which ones did you get immediately, and which did you need to look up?

Have a great weekend, and don't forget to be awesome!

![Small white dog wearing a bow-tie giving a high-five.](https://media.giphy.com/media/100QWMdxQJzQC4/giphy.gif)
What kind of apps have you implemented using a noSQL database like MongoDB or CouchDB?
Tags: discuss, mongodb, sql
Published: 2019-07-13 12:37:56

nosql database is the norm these days and yet RDMBS databases like mysql, sqlite and sql-server are very much relevant too.

Most popular open source CMS and apps like wordpress, drupal, Magento, Craft CMS, etc. continue to use an RDBMS database rather than nosql one.

What kind of apps have you developed where nosql had come useful (and there was a  better case or argument for using it against RDBMS for reasons)?

Do you think nosql databases are still suitable for traditional apps like ERP/CRM/FAS? Why and why not?
How to choose the best messengers for web development
Tags: webdev, webdeveloper
Published: 2019-07-15 14:30:01

---
title: How to choose the best messengers for web development
published: true
tags: Web Development,web developer,web development
canonical_url: https://kevinhq.com/how-to-choose-the-best-messengers-for-web-development/
---

Nowadays there are a myriad of messengers apps to use. Few of them are good for keeping communication inside the web development team. Then, how to choose the one that’s best suited? Functionalities Consider the functionalities of the messenger’s candidate app. At the very least, it should have these functionalities: Upload pictures. Based on my… 

[Read More »How to choose the best messengers for web development](https://kevinhq.com/how-to-choose-the-best-messengers-for-web-development/)
Chrome plugin - CloseMyTabs
Published: 2019-07-13 13:56:35

---
title: Chrome plugin - CloseMyTabs
published: false
tags: 
canonical_url: https://kambanthemaker.com//posts/chrome-plugin-closetabs/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/6lpedv8532b5dxt9vzzz.png
published: true
---

I used to open too many browser tabs, then find it difficult to close them. Many plugins outthere focus on suspending the tabs while I wanted to close the older ones. Having struggled with too many browser tabs, I built this to view & close browser tabs based on the last active time.

<iframe width="560" height="315" src="https://www.youtube.com/embed/XxGpjovCx9U" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Features

1. Close multiple tabs based on last access time
2. Adjustable duration
3. Badge count
4. Search bar to search based on title or URL
5. Opening a tab from the list
6. Ignore a specific tab
7. Multiple window support
8. Last accessed details
9. Favicon for easy identification

Download on Google Chrome Web Store: [CloseMyTabs](https://chrome.google.com/webstore/detail/closemytabs/pjjdjbdoipimhkcfidhnekpfcgahfjca)
What have you been watching on TV lately?
Tags: watercooler
Published: 2019-07-13 09:21:31

---
title: What have you been watching on TV lately?
published: true
description: 
tags: watercooler
---

Interested to know what other developers have been watching, or are looking forward to. Doesn't matter if it's something new, or something old you recently discovered.

No spoilers please!
Apinomics: Marketplace to pay less for smarter APIs
Tags: api
Published: 2019-07-13 09:03:33

Just launched a new platform for APIs and would like to get your thoughts. It is useful for the community. Apinomics is a marketplace to pay less for smarter APIs.

We really feel the pain that the business model of APIs is not fair and sometimes unrelated to the way we use APIs. In addition, quite often it can be a pain to navigate all the documentation and realize which API endpoints to call to fit the need and then parse the data to use the datapoints needed. We usually pay for all the data with a business model based on API calls. However, most often, we only use some of the data which might not be always useful for the final API user.

Because of this frustration, we created Apinomics. You can tailor your favorite APIs to your needs and pay only based on the value it brings to your business or project.

In more details it provides the following value:

1. REDUCE YOUR API COSTS

Pay for what you use. Get pricing adapted to the way you create value from APIs.

2. CUSTOMIZE APIS

Select only what you really need and mesh your favorite APIs together.

3. INTEGRATED APIS FOR LONG

We automatically tweak APIs or find alternative APIs in case of change. Your integrations will never break.

We provide some API examples on www.apinomics.co The platform is still invite only but you can request it from the website. In average we have calculated we can reduce the cost by 40%. We ambition to make any commercial API cheaper and smarter. I would love to get your feedback on this :)

On top, if you are interested in a specific API, let us know.

Many thanks
Painless global state management for React using Hooks and Context API
Tags: react, context, hooks, webdev
Published: 2019-07-13 09:01:17

It is out already 🎉🎉🎉

#use-global-hook

Painless global state management for React using Hooks and Context API in 1KB!

NPM: https://www.npmjs.com/package/@devhammed/use-global-hook

GitHub: https://github.com/devhammed/use-global-hook

Demo: https://devhammed.github.io/use-global-hook
Why decorators should be available everywhere
Tags: javascript
Published: 2019-07-13 08:35:22

Please show your support! https://github.com/tc39/proposal-decorators/issues/119

Let's dive in, I believe this sample will explain better than words.

``` js
class SimpleRouter {
   @get '/home'
   ({ res }) {
      return res.html();
   }

   @post 'submit/myform'
   ({ somePlugin, res }) {
      somePlugin.handleData(res.data);
   }
}
```
_ps. what do you think about that slightly hacky syntax, cool huh?_

But why can't this just be an object with decorators, I am forced to use a singleton for no good reason.

So people say you don't need classes but I'm afraid that syntactic sugar just keeps getting sweater.
How I did 12K commits in Github within 24 hrs
Tags: python, git, automation, commit
Published: 2019-07-15 13:10:26

---
title: How I did 12K commits in Github within 24 hrs
published: true
tags: python,git,automation,commit
canonical_url: https://medium.com/coolanant999/how-i-did-12k-commits-in-github-within-24-hrs-7908f755fe2d
---

### How I did 12K commits in Github within 24 hrs — Python Automation

![](https://cdn-images-1.medium.com/max/1024/1*rBuyTToyfshg5n_or5PIVA.png)

### So, I did 12K commits in Github within 24 hrs by running an automated python program.

This I would not say is a very useful tool to use, BUT IS SOMETHING MORE!!!!!  
Something to play with, have some fun, go others — WOAAAHHHHHH :P

WARNING: THESE ARE NOT ACTUAL CONTRIBUTIONS — — THIS IS A HACK, HAVE FUN. :P

> See my work at —

> In every 2 hours, the commits will automatically be increased by 1000.

> See my work. Give ⭐️ 👏

[coolanant/24hrs-automated-commits](https://github.com/coolanant/24hrs-automated-commits)

Just follow the link for more details.

> Or directly use —

[git-unlimited-commit](https://www.npmjs.com/package/git-unlimited-commit)

![](https://cdn-images-1.medium.com/max/1024/1*Y9X8vWRIdaeo9OoK-86MhQ.png)

* * *
What offends me the most, as a web developer
Tags: watercooler, humor
Published: 2019-07-13 06:49:10

I’ve been in the web development industry long enough, to become a bitter old man, who screams at kids in his neighborhood to get off his lawn.
So I decided to write a small list of things that push me to despair, every time I encounter them.

• Clients who contact me to build a website, and then back away in horror when I tell them about my rates, just because they thought I’d charge them around the same price as a Wordpress template. Really buddy? Really?

• Other web developers who think they’re holier-than-thou, just because they write code for a living. These are the same kind of people who go around telling everyone their IQ, and how smart they are just because they’re “developers”.
Junior developers that refuse to take advice from people with more knowledge and experience than them, because their hard throbbing ego keeps them from learning anything new.

• The pseudo-entrepreneurs that want you to build their app for free, in exchange for stock. These people actually want to reward you for your hard work, with stocks that are worth nothing, unless you build a product and give them value. I still can’t believe these individuals will contribute to humanity’s DNA pool.

• Developers who debate everything, literally everything. From spaces vs tabs to Linux vs Mac OS, and everything else in between. Holy fuck these people are annoying.

• Mouth breathers who call themselves designers, and proceed to buy and install themes when hired for a job. Don’t get me wrong, there’s nothing wrong with buying themes, but if you’re selling weed, you don’t get to call yourself a pharmacist.

I know, I’m fun at parties.

That’s it for this list, I really hope you enjoyed it, and if you did, please share it with your friends, it’ll mean the world to me as a writer.
[My website] (www.aladinbs.com)| [Twitter] (https://twitter.com/BenSassiAladin) | [Medium] (https://medium.com/@BenSassiAladin)| [Quora] (https://www.quora.com/profile/Aladin-Bensassi)
Securing APIs and Microservices with OAuth and OpenID Connect
Tags: microservices, security, webdev, tutorial
Published: 2019-07-13 05:19:22

Microservices present a new way of scaling API deployments, where each component is an island, performing a small but well defined task.

These systems are quicker to develop and allow for a more agile way of working. As in most designs, security is not part of the original blueprint, which can lead to expensive and hard to manage security solutions.

In this talk, Travis Spencer will illustrate how OAuth and OpenID Connect can be leveraged to created a unified distributed framework for Microservices. He will show how this can be used to deliver Microservices’ promise of agility and scalability while also ensuring security.

{% youtube hjoz12sD2I4 %}
What are some pros and cons of Single Page vs Backend Heavy apps?
Tags: discuss, webdev, javascript
Published: 2019-07-13 05:01:16

Currently the webdev world is in a kind of flux. The "FE Way", as some would call it, involves some mix of libraries like angular and vue for things like browser based routing (using hashes) and creating an MVC, plus some other libraries like react, material-ui, prime-ng, etc for handling the views. The backend is just a REST API and free to be implemented in any language you want.

The "BE Way", on the other hand, involves some old (but still proven and stable) libraries like jquery, bootstrap, etc. coupled with a backend language like php or python for handling web requests and HTML templating.

Which of these two ways is your preference and why?

The fe-way appears cool because you've separated your backend logic entirely into a REST API, now it doesn't matter whether its python or php, django or laravel. In a sense, its future-proof, isn't it?

Yet, I don't see many people moving to the fe-way, they are still using laravel, django, flask, etc., so what's holding them back still in the be-way? Is it just fear of the unknown or are there any genuine concerns with doing things in fe-way? Some basic issues I can think of are browser incompatibilities, lack of a robust and stable framework (angulars & vues keep coming and going, or keep reinventing themselves), npm problem of too many packages, etc.

If these issues were resolved, I don't think there'll be any major bottleneck for moving towards the fe-way.
Workaround: Killing Kibana Causing Elasticsearch Down / ELK 7.2
Tags: elasticseach, kibana, elk
Published: 2019-07-13 04:51:22

เรื่องมันมีอยู่ว่า ... ♫ ... ♫ ... เมื่อวาน ขณะกำลังนั่งปั้น ELK(K) stack 7.2 สด! ใหม่! ใส! กิ๊ก! อยู่นั้น ผมก็ทำไปตาม step มาตรฐานที่เคยทำมานั่นคือ install elasticsearch, performance test, enable security แล้ว performance test อีกรอบ จากนั้นก็จบด้วย setup kibana เป็นขั้นตอนสุดท้าย 

ทุกอย่างเกือบเรียบร้อยแล้ว จบกระทั้งเรื่องไม่คาดขวัญเกิดขึ้น

![img](https://media.giphy.com/media/2vqB3SPyzhSGO6ORQR/giphy.gif)

เชี่ย !!! process elasticsearch หายไปไหนนะ! ตาย!!! ทำไมตาย! error ก็ไม่มี

หลังจากสืบค้น ไปได้ซักพัก ก็พบว่า ...

> **ความจริงมีเพียงหนึ่งเดียว**

![](https://media.giphy.com/media/nkbHJf196TV7y/giphy.gif)

😫 เห้ย !!! นั่นมัน Conan The Barbarian

---

![](https://media.giphy.com/media/3o6UBp9jPYK7VI83II/giphy.gif)

😒 ยัง! ยังไม่เลิกอีก !!!! นั่นมัน Conan O'Brien

---

OK ! OK ! OK ! เพลงมา....

![](https://media.giphy.com/media/lITcaDWgInpra/giphy.gif)

ฆาตรกรในห้องปิดตายคนนั้นก็คือ init script ของ kibana นั่นเอง !!! แต่สาเหตุมันคืออะไรล่ะ ?

สืบเนื่องจาก kibana ไม่ได้ run ด้วย root ทำให้ไม่สามารถ สร้าง pid file ที่ /var/run ได้ พอเราสั่ง `systemctl stop kibana` หรือ `systemctl restart kibana` มันเลยไป kill process elasticsearch

ถ้า stop ผ่าน init script ตรงๆ จะไม่มีผลกระทบอะไร 

case นี้ผมคิดว่า น่าจะเป็นแค่ kibana 7.2 เท่านั้น เพราะอีก cluster ของผมที่เป็น kibana 7.1 ไม่พบปัญหา นี้

มาดู Environment ที่ผมพบปัญหากัน

```
OS: RHEL7.6
Kibana version: 7.2.0
Elasticsearch version: 7.2.0
```

วิธีแก้แบบปะผุ

1. `systemctl stop kibana`
2. `systemctl stop elasticsearch`
3. เพิ่ม `pid.file: /var/run/kibana/kibana.pid` to /etc/kibana/kibana.yml
4. แก้ /etc/init.d/kibana โดยเปลี่ยนจาก `pidfile="/var/run/$name.pid"` เป็น `pidfile="/var/run/$name/$name.pid"`
5. `systemctl edit kibana` แล้วใส่ ข้อความนี้ลงไป

   ``` ini
   [Service]
   RuntimeDirectory=kibana
   ```

6. `systemctl daemon-reload`
7. `systemctl start elasticsearch`
8. `systemctl start kibana`

เท่านี้ก็เรียบร้อย (～￣▽￣)～

![](https://media.giphy.com/media/ReImZejkBnqYU/giphy.gif)

---
The DEVpreneur Podcast
Tags: podcast, softwaredevelopment, entrepreneurship
Published: 2019-07-13 02:26:11

---
title: The DEVpreneur Podcast
published: true
description: A podcast where entrepreneurship and software development intersect
tags: podcast, software development, entrepreneurship
---


This week I released a podcast with my good friend and former co-worker [Tom Zaragoza](https://tomzaragoza.com/) called [The DEVpreneur](https://charliereese.ca/devpreneur-podcast). Tom and I met 18 months ago while working as software developers at Tulip Retail. We quickly learned we had similar interests; we both enjoyed building SaaS products in our spare time. 

We started [The DEVpreneur podcast](https://charliereese.ca/devpreneur-podcast) to talk about our common passion for where entrepreneurship and software development intersect. We cover things like common misconceptions, how to quickly build a product users want, and more. Our first episode had a bit of an echo, but I think we've since gotten rid of it. Who knew audio was such a tricky business - not me.

Further, we are hosting the [podcast's media files and RSS feed on my personal website](https://charliereese.ca/devpreneur-podcast/rss). If you are interested in how to do this for your own podcast, I wrote about [how to host your own podcast RSS feed](https://charliereese.ca/blog/45-how-to-host-your-own-podcast-rss-feed) on my blog - you should check it out!

### Do you have a favourite podcasts that you listen to, or do you host your own podcast? I'd love any tips or resources!
Getting Started with Node.js
Tags: node, javascript, webdev, tutorial
Published: 2019-07-13 02:22:59

Learn to leverage the power of server-side Javascript with this Node.js introductory tutorial. We’ll dive into Node’s architecture and understand the build and dependency management systems involved. Several modules for Node will be demoed, and we’ll learn how to debug Node applications within an IDE. You’ll come away with an understanding of what sets Node apart from traditional Javascript, it’s inherently asynchronous and event-driven architecture, and take a look at some real world applications built on Node.

{% youtube DjM0wSpzJj8 %}
Review of Introduction to Discrete Mathematics for Computer Science Specialization
Tags: learning, mooc, beginners, math
Published: 2019-07-13 02:18:23

---
title: Review of Introduction to Discrete Mathematics for Computer Science Specialization
published: true
description: Learning math using Jupyter Notebook and more tools
tags: learning, mooc, beginners, math
series: MOOC reviews
cover_image: https://images.unsplash.com/photo-1453733190371-0a9bedd82893
---

*This review has been originally written Nov/2018.
Looking now, It's super poorly written and horrible to read.
However, refactoring this review is out of my capacity.
Thank you for your understanding of that.*


---

[Introduction to Discrete Mathematics for Computer Science Specialization](https://www.coursera.org/specializations/discrete-mathematics)

Since I do not have much knowledge of mathematics, It makes me worry to study computer software, so that what was the reason I wanted to study a bit about it.

The specialization has consisted of five courses; Mathematical Thinking in general(mostly puzzles),  Combinatorics and Probability, Graph Theory, and Number Theory and Cryptography. At first, I heard that the courses had no prerequisite rather than basic math and curiosity about the topics alongside some of Python knowledge. How ever, for me, some math-y topics were a bit tough for me, so I had to watch videos several times, and do a bit of extra research about the details. The courses provide many puzzles and cording implements exercise as well as quizzes to have a dipper understanding of the topics. Especially the instructors show examples with Python codes, which not only help better understanding but also let the students see the potential of the language itself while being more familiar to it. In the cording exercises, they provide some basic structures to start with, so it was not absolutely difficult for them by oneself. The instructors also very kindly help inquires by the discussion forum, to help if there is any question or obstacle through the learning.

I am happy that I now have a little bit of experience about the many interesting topics so I could have a better mindset when I face problems in the future. I hope I now have less fear for my study, and I could have some more chance to study a bit more about discrete mathematics and related topics.

---

This course is made with almost the same instructors from [Data Structures and Algorithms Specialization](https://www.coursera.org/specializations/data-structures-algorithms), which a large program and one of the course is one [I dropped out](https://dev.to/ljuneaul/review-of-algorithmic-toolbox-24go).
This is actually kind of prerequisite for those courses.

This one was also changing but was certainly doable even for someone who has low math knowledge such as myself.

*Lastly, iirc, some part of Specialization uses Jupyter Notebook and NumPy, which I didn't know that was a "thing", back then.*
HTML or JavaScript, what should I write my Markup with?
Tags: discuss, javascript, html
Published: 2019-07-13 02:06:23

Let us say that my website have a lot of things shown when i press button, which better: 
1- having the Markup in the HTML file and use display {none, block, etc}
2- write the Markup using JavaScript with the function createElement

and why?
Thank you all !