teleren/devto huggingface dataset:
Mern(MongoDB, Express JS, React JS and Node JS) Stack
Tags: node
Published: 2019-10-27 22:02:49

---
title: Mern(MongoDB, Express JS, React JS and Node JS) Stack
published: true
description: Boilerplate for getting started with MERN stack 👩‍💻👨‍💻
tags: node 
---
Mernless provides a powerful Boilerplate which makes it easy to build isomorphic apps using Mongo, Express, React and NodeJS. It minimises the setup time and gets you up to speed using proven technologies. Mernless takes the pain out of development by easing common tasks used in many web projects, such as:
- Scalable and Maintainable Mern architecture
- Robust routing
- Database caching
- JWT authentication
- (Redux, Mail, Swagger, Docker, Travis) integration
- Command-line interface

GitHub : https://github.com/getspooky/Mernless
Documentation : https://getspooky.github.io/Mernless/
Mern(MongoDB, Express JS, React JS and Node JS) Stack
Tags: react
Published: 2019-10-27 21:58:03

---
title: Mern(MongoDB, Express JS, React JS and Node JS) Stack
published: true
description: Boilerplate for getting started with MERN stack 👩‍💻👨‍💻
tags: react
---
Mernless provides a powerful Boilerplate which makes it easy to build isomorphic apps using Mongo, Express, React and NodeJS. It minimises the setup time and gets you up to speed using proven technologies. Mernless takes the pain out of development by easing common tasks used in many web projects, such as:
- Scalable and Maintainable Mern architecture
- Robust routing
- Database caching
- JWT authentication
- (Redux, Mail, Swagger, Docker, Travis) integration
- Command-line interface

GitHub : https://github.com/getspooky/Mernless
Documentation : https://getspooky.github.io/Mernless/
Is it practical to take notes directly in HTML???
Published: 2019-10-27 21:18:03

I usually take notes which have code snippets and stuff in Markdown, and view it in my Github. But there are certain things that I can't do with Markdown properly, such as Latex support, or controlling how it looks on Github. https://easytax.onl/irs/

To get through these hurdles, I was considering writing notes in HTML instead. Can this be as easy as writing in Markdown with the help of snippets, etc? I use vim, so https://citeref.com/easybib/ things should be fairly customizable. It should be more or less little hassle to convert from .md to .html with pandoc. https://nitroloan.onl/fedloan/

What do you guys think? Can you take notes fast and readably with HTML?
How do you test new UI widgets?

Published: 2019-10-27 21:17:10

ell me how you test a brand new UI widget that you just created! It can be anything as long as https://pcbuilder.onl/pcpartpicker/ it is a  https://curated.onl/nba-reddit/ self-contained, single main purpose unit, UI control, widget, or call it whatever you want. You can go into detail about how you solve the initial idea (do you just write code, or use XML as well?https://reversephonelookup.onl/
Want to monitor Kubernetes? Start with collecting logs!
Tags: kubernetes, beginners, devops
Published: 2019-10-27 21:16:11


Logs analytics is a challenge that interested many people. 
We see it directly from the increasing number of startups and initiatives. 
Big companies build their solutions too.

Since there is no native storage for Kubernetes logs solution, we will look at 3 approaches:


## Basic logging in Kubernetes
Output the logs to the standard output stream.
This can be configured from the YAML file.

![](https://media.tenor.com/images/c0f90ac193b2a24589fcc6ce1fc35ba2/tenor.gif)



## Logging at the node level

![](https://d33wubrfki0l68.cloudfront.net/59b1aae2adcfe4f06270b99a2789012ed64bec1f/4d0ad/images/docs/user-guide/logging/logging-node-level.png)

Have the stdout or stderr redirected to some storage or file by a container engine.
This has pros and cons. From [K8s](Kubernetes.io):
_" if a container restarts, the kubelet keeps one terminated container with its logs. If a pod is evicted from the node, all corresponding containers are also evicted, along with their logs."_

The responsibility of the logs is on us. Hence, we need to define [Log Rotation](https://linux.die.net/man/8/logrotate).
Log Rotator mechanism is in charge of: __rotate__, __compress__ and __send__ . This is usually a daemon that is scheduled to run every X minutes.




## Cluster-level logging architectures

Due to the fragility of pods, containers and nodes in distributed systems, we should consider  _cluster-level-logging_.
_cluster-level-logging_ requires a separate backend to store, analyze and query the logs.

Some options are: ( from Kubernetes.io)

* Use a node-level logging agent that runs on every node.
* Include a dedicated sidecar container for logging in an application pod.
* Push logs directly to a backend from within an application.

![](https://media.tenor.com/images/162a16e2fcd96e40740a25e17abed5b7/tenor.gif)



__This was Kubernetes logs in under 2 minutes!__ 
### 💡 Curious to learn more? check this:

* [View and Monitor K8s logs in real time](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-live-logs?WT.mc_id=devto-blog-adpolak)
* [Configure Agent Data Collection](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-agent-config?WT.mc_id=devto-blog-adpolak)
* [Practical Guide to Kubernetes Logging](https://logz.io/blog/a-practical-guide-to-kubernetes-logging/)
CSS variables, input[type="color"] and form animations
Tags: showdev, css, javascript, webdev
Published: 2019-10-27 20:52:47

I was contemplating not sharing this because I was like "Meh it's pretty simple, anyone can do it" but then I reminded myself that the word "simple" is very relative, and there was a time in my life when this would have made me 🤯

(this is a good thing to think about for anyone who hesitates on writing blog posts! Just because you think "everybody knows this stuff" doesn't mean it's true. Lots of people do NOT know this stuff.)

Anyway, I was just in the mood to play around with checkbox/radio button animations and as I went along got carried away and added customization. Here we are:

{% codepen https://codepen.io/roseyrobertson/pen/vYYZjOX default-tab=result %}

### Quick stuff to know about

- Checkbox "x" animations use CSS gradients for the progressive "growing" of the x/"filling" of the box
- The x elements themselves are `::before` and `::after` pseudo elements rotated on an angle so that they form diagonal lines, crossed over one another.
- Radio buttons use "scale" transition animation for the circle to grow-in/shrink-in
- `<input type="color">` is how you get that color picker input
- [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) (variables) are how you easily have the user pick a color.
- [I found this little colour manipulation library](https://github.com/bgrins/TinyColor) so that after someone picks a colour, I can find lighter/darker versions.
- 🐛 Safari is annoying in that when you change the accent colour, it doesn't seem to properly update already-checked items that used a gradient animation, so you have to uncheck and recheck. Chrome/Firefox seem to update correctly.

You can of course view the source to see all the nitty gritty 🙂
Immutable objects with preventExtensions(), seal(), and freeze()
Tags: javascript, webdev
Published: 2019-10-27 20:29:42

There are times where you'll have an object and want to preserve it's properties and restrict its behavior. This is when we can reach for `preventExtensions`, `seal`, or `freeze`. 

Let's create an object with several properties. We'll be working with the same object as to avoid confusion. 

```javascript
const village = {
 elder: "Greybeard",
 population: 120
}

```

##preventExtensions()

`Object.preventExtensions()` prevents new properties from being added to the object that's passed as its argument. Let's see how that works.   

```javascript
Object.preventExtensions(village)

village.group = "outsiders" // TypeError: can't define property "group": Object is not extensible
```

Above, we attempted to add a new property to our object. By using `preventExtensions`, we prevented a group of outsiders from entering our `village` object.

##seal()

`Object.seal()` borrows from `preventExtensions` by not allowing new properties to be added to an object and also preventing properties from being deleted. 

```javascript
Object.seal(village)

village.group = "outsiders" // TypeError: can't define property "group": Object is not extensible

delete village.elder // TypeError: property "elder" is non-configurable and can't be deleted

```

We see that we cannot add a group or remove our existing elder from the `village` object. However, we can still change our `elder` because our properties are writable. Let's see what that means.

```javascript
Object.seal(village)

village.elder = "Blackbeard" 

console.log(village.elder) // "Blackbeard" 
```
Our `elder` has now become Blackbeard.

##freeze()

`Object.freeze()` takes from both `preventExtensions` and `seal` in that We cannot add new properties and we cannot delete existing properties. The new addition is that it also prevents existing properties and their values from being changed.

Remember the writable issue with `seal`?

```javascript
Object.freeze(village)

village.elder = "Redbeard" 

console.log(village.elder) // TypeError: "elder" is read-only
```
NOTE: `Object.freeze()` only does a shallow freeze. Nested objects will not be frozen. 

##Overview 

Each method has its own use case and I don't blame you for not remembering them off the bat (I sure as heck didn't and still get confused from time to time). What helps me is to start from the least restrictive and work my way up from there. Also, breaking down the actual syntax is what helped me the most. 

Here's my odd rationale behind remembering them.

You have three sisters with superhuman abilities. From the oldest down, each sister gets a new ability while maintaining the ability of the other. 

- Oldest sister - `Object.preventExtensions()`: You can't (extend) add more properties. 

- Middle sister - `Object.seal()`: Seals an object, preventing properties from being deleted (What's inside cannot get out). Acquires the same ability from `preventExtensions`.

- Youngest - `Object.freeze()`: Freezes an object (nothing can be altered) and borrows the abilities from `preventExtensions` and `seal`.
What are you excited to learn next?
Tags: discuss, learning
Published: 2019-10-27 20:25:48

As developers and technologists, we are constantly exploring new tools and languages.  The constant learning process and exposure to so many different technologies and styles of creating is a large part of what makes me passionate about Software Development.  So, this week, I want to ask: 
### 1. What are you excited to learn next?
### 2. What interests you about it?

Personally, I have been exploring [Go](https://golang.org/).  I am curious about its popularity and interested to compare it to some of the languages I use now.
TabView with ViewPager
Tags: android
Published: 2019-10-27 20:18:13

I create a tabview with viewpager to display the indicators, so How I can disable the click on these indicators and just click on viewpager 



my code:


 <com.google.android.material.tabs.TabLayout
        android:id="@+id/tabDots"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabBackground="@drawable/tab_selector"
        app:tabGravity="center"
        app:tabIndicatorHeight="0dp" />
DEV-CLI 0.2.0
Tags: showdev
Published: 2019-10-27 19:42:39

---
title: DEV-CLI 0.2.0
published: true
description: More complete API wrapper and new internals
canonical_url: https://github.com/Xowap/dev-blog/blob/master/articles/showdev/dev_cli_0.2.0.md
cover_image: https://thepracticaldev.s3.amazonaws.com/i/3wqyf6zw9c86tm06otk1.jpg
tags:
    - showdev
---

These last days I have been working on a [Retrofit](https://github.com/square/retrofit)-inspired library for Python called [Typefit](https://github.com/xowap/typefit). Since it's clearly not ready for production use yet I'm not doing an introductory post just yet, however as I'm learning to use it in real life I've decided to migrate [DEV-CLI](https://github.com/xowap/dev-cli) into using Typefit.

This new version does not bring any particular feature (nor any feature at all actually), however two changes emerge:

- The internal API wrapper is now type-safe and much more complete
- Instead of some boilerplate code it uses the Typefit API client builder

That is clearly not the news of the year but I also needed to test if this new version of the API works so I had to write an article :)
TIL: The pecularity of the sort function
Tags: javascript, todayilearned
Published: 2019-10-27 19:41:20

Today I learned something strange about the `sort` function in JavaScript.

This evening I was going through a course on algorithms in JavaScript. The instructor gave a task to create a unique sort function that took an array, removed duplicate values and sorted it in ascending order.

They gave some starting code to work with:

```javascript
const uniqSort = arr => {
  const breadcrumbs = {}
  return arr.sort((a, b) => a - b)
}
```

Before tackling the task at hand I said to myself: aha! I don't need to have that function within `sort` as the `sort` function already sorts in ascending order!

But then I thought to myself: wait, the instructor put that there for a reason. Let's find out why.

So I went digging. Here is [the documentation on the `sort` function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort).

> If compareFunction is not supplied, all non-undefined array elements are sorted by converting them to strings and comparing strings in UTF-16 code units order.
> ...
> In a numeric sort, 9 comes before 80, but because numbers are converted to strings, "80" comes before "9" in the Unicode order.

Pardon?

So, if I do the following:

```javascript
[1, 80, 9].sort()
```

I get


```javascript
[1, 80, 9]
```

Because my array values are converted to strings before sorting. And as we saw before, "'80' comes before '9' in the Unicode order"

I'm told this is a common "gotcha!" and I didn't encounter this issue in the 4+ years I've been a developer. I count myself lucky as I bet that would have been annoying to debug.

Make sure you always do your sorts with a function!

```javascript
[1, 80, 9].sort((a, b) => a - b)
```


I'm so curious about why this decision was made when the `sort` function was originally written. If anyone knows please comment. What other weird things in JavaScript do you know about that I might not?
Microsoft MIT license for VSCode
Published: 2019-10-27 19:41:15

This is very similar to the license AT&T grznted to USC Berkley for UNIX. USC won the case when sued by AT&T. The license is contradictory but even FOSS requires the copyright to be published. And all open source software can have the license changed at sny time. Remember the tools for 3D imaging on the Microsfr 3D camera for their gaming system. Apple bought the open source company and close spured the developees almost overnight.
You can't stop the benefits of rightful ownership. And a copyright superceeds all other licensing rights. It may not seem right, but at least Microsoft was hinest enough to spell it out.
Server writing adventures in Node
Tags: node, javascript
Published: 2019-10-27 19:33:34

Fascinating. Stardate-who-knows what, but we're en route to writing a minimal server. 

It'll (most likely) meet its days somewhere down the line, but it's important to get experiments done for now. Developing code has been that for as long as the collective memory of homo sapiens remembers; experiments, problems; and then the blissful flow! Some backing up - and new code again. That's what a commit is made of.

My server's mission is:
- take in API requests (mobile clients, ie smartphone)
- parse the request
- find out whether "you" (server) has the data (a tuplet; two variables defines the target)
- if Yes, render the result back to caller
- if Not, make it known that the call could not yield the data

Resources are your naming convention for the objects contained within the server's knowledge. Resource naming can make or break how popular your API will be: logical and concise naming helps writing client code, a lot. 

I was starting to writing a first endpoint, using 'express' as a base to build on. Then I started to really think about two things:

1) performance 
2) error handling

I'll keep elucidating my server adventures in the next part. Happy coding!
Interclip
Tags: clipboard, productivity, php, javascript
Published: 2019-10-27 19:17:46

Hi devs,
I want to ask you a question: Do you use the same operating system and tools for everything you do at work (or home)? If your answer is yes, well, then there's nothing to worry about but if not, a tool I made may come in handy.
You probably use a deployment tool for your work (if you do web development), or you have a documentation website which you want to read on your computer. For both of those things (and anything else URL related), you can use Interclip. 

## What is Interclip?
Interclip is a modern solution for sharing URLs with yourself or someone else. You probably share URLs by just emailing them to yourself, right? Think about it. Isn't this just like... dumb? Filling your inbox and taking so much time is just nonsense. If you use Interclip, you can just paste a URL and get back a five-digit randomly generated code. This code you can then input on your other device (doesn't even have to be yours) and get the URL back.

## Don't know where to host a file? Interclip can also help
Interclip is not just about URLs, but also about files. Any file smaller than 100 MB can be uploaded to Interclip and never be deleted. So you can host anything because there's also no file-type limitation. Also, every file is encrypted so no-one else will be able to see it.

## API? Of course we do
There's also a very simple API for developers to use. Check the documentation for details.

## Open Source
The entirety of Interclip is open source. I am working on it just by myself now so any contributions are welcome! And if you're not really into web-development or you don't have the time, a star on GitHub would be very appreciated. 

The APP: [interclip.app](https://interclip.app)
Github repo: [aperta-principium/Interclip](https://github.com/aperta-principium/Interclip)

Thanks for reading. Happy developing!
Why Most Workshops suck?
Tags: discuss, tutorial, techtalks, opensource
Published: 2019-10-27 19:08:10

So it's 1:40 at night, and I cannot sleep (as usual). But how about writing about my thoughts this time? Due to some 
recent discussions with some people, this is the topic which I had in mind for a few days.

First I would like to highlight the word **most** here.

First, let's go back a year. We all heard the news that a three-month Internship would be compulsory for our batch 
in order to complete our B.Tech. program. First thing that popped into my head:

**Great !!! Now companies will start selling Trainings in the name of Internship.**

And it wasn't much later that I saw all this coming true. Though it was not just the companies, it included some very 
prestigious Universities as well. Well, no issue, maybe they will teach the students the right way and do justice to the 
large amounts students are paying. 

### Why I think that it won't ever be true:

Leaving the case of Companies/Universities doing this just for money (no solution to that except that the students 
should make smart decisions themselves), let me explain why workshops are no good even when the company/university 
themselves want good for the students. 

As we know, there is no screening process in such workshops/training. So, a curious student who wants to learn, and a 
student with no interest in the topic are both in the same class, being taught from the same teacher. And we all know 
that the amount of later type of students is much much more than the former. 

The workshop organizers want you to learn, but they won't ever teach things which more than half the class cannot 
understand. They would want to meet the level of everyone present in the class. All they do is give those students the 
*Hoax of knowledge* (instead of telling them how much more there is to explore in that field)
leading to ignorance, which is enough to stop their learning process. What a waste of time for the student who was actually there to learn. 

All Workshop organizers care about are positive reviews. They want more participation next time. Their goal is to leave 
you with you feeling smart. So basically, workshops/training programs quality sucks, almost always.

Students attending such workshops should also know:
> Some skills are too complex for short-term intensive training to be effective.

And coding is definitely one of those skills.

Workshops are a fad and a waste of time and money.

### So all workshops/training programs suck?

I think mostly which are paid. Maybe I think so because I have used free resources to learn from the time I started 
coding and things are much more clear and innocent when money is not the reason for transfer of knowledge, curiosity is.

### But where to learn from then?

MOOCs MOOCs MOOCs !!!!!!!!!!
          
MOOCs are free, taught by world experts (not kidding). Some of the best teachers in the world are out there, writing 
books, blogs, making MOOCs, for you, why would you opt for a training program dude?