teleren/devto huggingface dataset:
Helm2 in GKE
Tags: gke, helm2
Published: 2019-11-14 16:40:16

```sh
$ kubectl create serviceaccount -n kube-system tiller

$ kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

$ kubectl --namespace kube-system patch deploy tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
```
Monadic null checking in ES6
Tags: es6, proxy, monadic
Published: 2019-11-14 16:38:58

## Hola, readers

I'd like share you guys my journey of moving from C# world to JavaScript.

First and last, it was fun.

Of course, there're some features I really miss,
One of them is the beautiful `Monadic null checking` in C#.

Some of you might have no idea.
Let me tell, you can do something like
```c#
var duck = new Duck();
Console.WriteLine(duck.Name?.ToLowerCase() ?? "again? duck has no name");
```

When `duck.Name` is `null` it won't throw exception, instead it ignores the rest of statement replacing with `null`.
Then we can simply use `??` operator to check weather it's `null` or not

> Basically, we can say, if `duck.Name` is `null` use default value

That's it! brilliant, loved it !.
This feature is amazingly powerful and save up lots of null checking line of code.

But in JavaScript ... THERE IS NO SUCH THING! WHY?

No worry, it's time to use Google to search good things, my friend.

Apparently, there're soooo many questions like this in StackOverflow,
now I know that people are struggling, upsetting, drowning in his/her own null checking code

And there are helpful valid answers:
- Use `try` `catch`
=> Nah (dunno why, but, nah)
- Use `Lodash.get`
=> Nah (hate when I'm forced to use string!)
- Use `ES6`'s `Proxy`
=> Nah! ... oh! this is new, this is new.


Let's see, what it can do.

> The Proxy object is used to define custom behavior for fundamental operations (e.g. property lookup, assignment, enumeration, function invocation, etc).
[developer.mozilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)

Whoaaa !.. sounds good but I don't understand

After years of researching `ES6`'s `Proxy`
Finally, I did it!

Here it is. (I'm not gonna explain anything about this code, since I have to do dishes and clean my house, sry, duty calls) 

```javascript
// proxyLib
const proxies = new WeakSet();

const def = (o, d) => {
    return proxies.has(o) ? d : o;
}

const getEmptyProxy = () =>
    new Proxy({}, {
        get: (t, p) => {
            const pr = getEmptyProxy();
            proxies.add(pr);

            return pr;
        }
    });

const getProxyObject = (obj) => {
    return new Proxy(obj, {
        get: (target, propertyName) => {
          const value = target[propertyName];

          if (!value && value !== 0) {
            return getEmptyProxy();
          }

          return value;
        }
    });
}




// main
const obj = {
    a: 1
};

const proxiedObj = getProxyObject(obj);

console.log(def(proxiedObj.a, "hello")); // 1
console.log(def(proxiedObj.b.c.d.e.f.g, "world")); // world
```

That's it everyone, thanks for reading, hope you guys enjoy.
Feel free to comment, I rather not reply back, since I already have too many haters. Anyways, see you.

Peach...

dang auto correct

Peace
Check out how this fashion site shows products
Tags: discuss, watercooler
Published: 2019-11-14 16:12:45

---
title: Check out how this fashion site shows products
published: true
description: 
tags: discuss, watercooler
---

Came across this dope site with a lot going on, wondering what Devs think when they see sites like this?

https://shop.manrepeller.com/pages/play
Boost your GraphQL development with GraphQL Zeus
Tags: javascript, typescript, graphql, showdev
Published: 2019-11-14 16:02:57

---
title: Boost your GraphQL development with GraphQL Zeus 
published: true
description: GraphQL client & code generator working with a browser, Node.js & React Native.
tags: javascript,typescript,graphql,showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/9avkc7yrdzbq36q9a56x.gif
---

[GraphQL Zeus](https://github.com/graphql-editor/graphql-zeus) is an open-source ([MIT](https://github.com/graphql-editor/graphql-zeus/blob/master/LICENSE.md)) graphql client & code generator working with a **Browser, Node.js & React Native**. It provides an auto-complete client library for JavaScript or TypeScript supporting auto-completion for strongly typed queries. It's maintained by **Artur Czemiel**

{% user aexol %}


## Installation & Basic usage

To play with it use npm install:

```
$ npm i -g graphql-zeus
```

Zeus supports:
- Javascript (Browser, NodeJS, React Native)
- TypeScript (Browser, NodeJS, React Native)

![Zeus in action](https://raw.githubusercontent.com/graphql-editor/graphql-zeus/master/images/zeusexample.gif)

[GraphQL Zeus](https://github.com/graphql-editor/graphql-zeus) provides many useful solutions among which you can find such as:

- **Chain** - Chain is the main function responsible for forming a GraphQL Query. It provides auto-complete in Zeus Syntax. Returned data is mapped accordingly to GraphQL query, so you get type-safe completion for both query and response in both *TypeScript* and *JavaScript*.

- **Aliases** - You can alias each query just like in GraphQL original specification. To use `alias` you just need to provide `__alias:{[YOUR_ALIAS]:YOUR QUERY}`

- **Selectors** - If you use same GraphQL query many times you can use `Selectors` which you can later inject into the `Chain` function


###JavaScript &  React Native:

```
$ zeus schema.graphql ./
```

### TypeScript:

```
$ zeus schema.graphql ./  --ts 
```

### Node.JS:

```
$ zeus schema.graphql ./  --node 
```

## Want to contribute? 
Awesome, just:
1. Fork this repo
2. Create your feature branch: `git checkout -b feature-name`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request

{% github graphql-editor/graphql-zeus %}

---
### Speed up your GraphQL API development

[GraphQL Editor](https://graphqleditor.com/) is a supportive tool for both advanced GraphQL users as well as those taking their first steps with GraphQL APIs. Our all-in-one development environment for GraphQL will help you build, manage & deploy your GraphQL API much faster thanks to dozens of built-in micro features. Its graphical interface will also fix communication within your product team. Visualization is the key!

[![GraphQL Editor](https://im4.ezgif.com/tmp/ezgif-4-5c1ceab7b19e.gif)](https://graphqleditor.com)
Wanna check status of your services in one click? Let's build it together
Tags: port, services, status, netstat
Published: 2019-11-14 15:52:01


---
title: Wanna check status of your services in one click? Let's build it together
published: true
description: Porter is a tiny tool that searches for our specified ports from netstat and displays message in red or green color.

tags: port, services, status, netstat
---
Porter is a tiny tool that searches for our specified ports from netstat and displays message in red or green color.

[Link to github](https://github.com/sbimochan/porter)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ji8fo0j7in1f6s5blrol.jpg)
What is this "Event Loop" that they speak of in Javascript?
Tags: javascript, webdev, computerscience
Published: 2019-11-14 15:46:12

👨🏾‍💻I dug into the workings of the _**Javascript event**_ loop and created this video which is **one of the top 5 videos** for that topic on YouTube (as per search results). Do give it a watch and let me know if you learned something new today. 🤟🏾

### The context

When I started learning javascript, I thought that it was just a tool to add functionality to a static web site. The more I dug into the language, the more I found out there is to it. And there had to be. With the giants of the tech world like Netflix, Airbnb, Uber building several of their micro-services using Node, there had to be something special about this language. 

And there was. The way in which javascript handles events is one of the core qualities that differentiate it from most of the other players out there. The event loop is that piece of the puzzle that enables the main javascript thread to run on a single thread, yet provide a smooth interface for async stuff like network, i/o, etc.

It is something that we as developers don't pay much attention to when we start learning a language, the syntax, the semantics but only start to wonder about a little while later when we have the basics figured out. Only when an "aha" moment occurs and you wonder "how did that code work (or not work, for that matter) when you start to deep dive and uncover secrets. Nevertheless, getting to know what you did not know until that moment progresses you on another level as a developer. 

{% youtube XzXIMZMN9k4 %}

Hope that helped, Cheers!
<!-- This won't show up in the content! 
{% instagram BXgGcAUjM39 %}

{% github thepracticaldev/dev.to %}

{% twitter 834439977220112384 %}

{% listing https://dev.to/listings/collabs/dev-is-open-source-823 %}

{% devcomment 2d1a %}

{% tag git %}

{% user comscience %}

{% link https://dev.to/kazz/boost-your-productivity-using-markdown-1be %}
-->
Write Better Frontend Components with This Tip
Tags: javascript, vue, react, webdev
Published: 2019-11-14 15:26:31

Components are the basic building blocks used in modern frontend frameworks like React, Vue, and Svelte. Well-written components can improve the overall structure of your app and make it clean and maintainable.

It's likely that you've heard about the [presentational and container components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0) pattern. In some cases, this might be a helpful pattern to use — but not always. I've used this pattern throughout a complex project and I've ended up with a lot of boiler-platy components.

After writing lots of components and building complex frontend applications, I realized that we have only two types of components: *UI general-purpose components* and *app-specific components*.

Understanding what they are for and how to write them will help you design better components and ultimately better application architecture.

## UI general-purpose components

They are pure UI components that are not made for a specific application. They are used for general UI elements like multi-select inputs, modal boxes, pagination links, etc.

So these components:

- Can be shared easily from project to project
- Don’t depend on the state of the app
- Don't have access to global data
- Don't make AJAX requests
- Just take props and emit events
- Are good for npm packages

So UI libraries like [Vuetify](https://vuetifyjs.com/en/) and [Material-UI](https://material-ui.com/) are considered UI general-purpose components.

## App-specific components

They are components that you implement specifically for your app, and it doesn't make sense to use them somewhere else.

These components:

- Can be used only inside your app
- Depend on the state of your app
- Can have access to global data and use state management libraries like Vuex and Redux
- Can make AJAX requests directly
- Can use specific terminologies based on the app's domain — so name variables/functions whatever you want
- Can be reused throughout your app, but they don't have to
- Can take props and emit events

A good example is a form component. This component will only work inside your app. It can render its fields based on the state of your app, submit its data directly with an AJAX request, and be reused when updating the data instead of creating it.

So the key to writing better components is to not confuse the two component types. For example, you don't have to create a single component called *Form* and reuse it for all forms in your app. Instead create as many form components (with specific fields) as you need.

---

I hope you enjoyed this article. For more stuff like this, follow me on twitter [@tahazsh](https://twitter.com/tahazsh) and subscribe to my blog's [rss feed](https://api.tahazsh.com/feed).
Is it possible to program from a tablet?

Tags: programtablet
Published: 2019-11-14 15:01:47

Is it possible to program from a tablet?
Regards
I was analyzing that it is possible to develop on a tablet, regardless of the Android or IOS system, I used an online editor like https://codesandbox.io ,the database https://firebase.google.com/ , https://github.com at https://www.netlify.com.

Is it possible to program from a tablet?
Build Great User Experiences with Concurrent Mode and Suspense with Our New Relay Workshop with Sibelius Seraphini!
Tags: react, graphql, javascript
Published: 2019-11-14 14:52:54

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/t4ntv707yzpw3pg1wjm2.jpg)
We’re super excited that [Sibelius Seraphini](https://twitter.com/sseraphini), one of the most proficient open source contributor in the community, will be [giving a workshop on Relay.js](https://www.react-europe.org/#slot-2154-workshop-build-great-user-experiences-with-concurrent-mode-suspense-with-relay-may-16th-) with all the latest bells and whistles on the 16th of May.

If like us, you religiously watched the latest presentations on how the React, Relay and Facebook webcore team cooperated to build the new Facebook F5 and if you’ve been wanting to build [the same optimizations that come with concurrent mode into your own apps](https://reactjs.org/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense.html), then this workshop is for you!

Here are some of the points you will learn:

*   Best Practices for Suspense
*   Load Data Incrementally: Dynamically loading code and using fragments for your components
*   Render As You Fetch pattern via the preloadQuery() and usePreloadedQuery()
*   Using useTransition to make route transitions more seamless
*   usePaginationFragment for colocation of data-dependencies with the view and pagination
*   using the relay compiler to take advantage of TypeScript types with GraphQL types

You’ll learn how to put all these techniques together to bring the best experience possible to your users.

**And if it gets released by May, we’ll also include the new SSR API and more.**

While Relay has had a reputation of being a bit more complex than other GraphQL clients alternatives, it's been way more simple and flexible since the Relay Modern release and Sibelius is a really passionate early user of it and he will make a great job of explaining it to you. Relay also remains unmatched when it comes to optimizations, cache management, concurrent mode and more.

Good knowledge of React and beginner in TypeScript and GraphQL are required.

Get your ticket here [https://www.react-europe.org/#tickets](https://www.react-europe.org/#schedule-item-1805)

**Also in case you missed it, we have six other workshops to choose from about** [React.js, React Native, GraphQL, Next.js, Gatsby, Forms](https://www.react-europe.org/#schedule) and more**.**

Looking forward to see you there!

\-the [ReactEurope](https://twitter.com/reacteurope) team

PS: if you would like to sponsor the conference, get in touch with us at reacteurope@eventlama.com
Daily Challenge #117 - MinMinMax
Tags: challenge
Published: 2019-11-14 14:26:47

---
title: Daily Challenge #117 - MinMinMax
published: true
series: Daily Challenge
description: Given an unsorted array of integers, find the smallest number in the array, the largest number in the array, and the smallest number between the two array bounds that are not in the array.
tags: challenge
---

Given an unsorted array of integers, find the smallest number in the array, the largest number in the array, and the smallest number between the two array bounds that are not in the array.

For instance, given the array [-1, 4, 5, -23, 24], the smallest number is -23, the largest number is 24, and the smallest number between the array bounds is -22. You may assume the input is well-formed.

Your solution should return an array `[smallest, minimumAbsent, largest]`

The `smallest` integer should be the integer from the array with the lowest value.

The `largest` integer should be the integer from the array with the highest value.

The `minimumAbsent` is the smallest number between the largest and the smallest number that is not in the array.


`minMinMax([-1, 4, 5, -23, 24]); //[-23, -22, 24]`
`minMinMax([1, 3, -3, -2, 8, -1]); //[-3, 0, 8]`
`minMinMax([2, -4, 8, -5, 9, 7]); //[-5, -3,9]`

***

_This challenge comes from kodejuice on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Spring Boot in Visual Studio Code
Tags: java, spring, vscode, tutorial
Published: 2019-11-14 14:03:57

---
title: Spring Boot in Visual Studio Code
published: true
description: In this tutorial, I will show you how to create a new Spring Boot Project in Visual Studio Code
tags: java, spring, vscode, tutorial
cover_image: https://thepracticaldev.s3.amazonaws.com/i/75jbnzuvmkyo1xrt2sjd.png
---

I use Visual Studio Code for everything these days. In the past couple of months alone I have used it for HMTL, CSS, JavaScript, Java, Spring, C#, Go, Vue, Angular, and TypeScript. 

A few folks were surprised when I told them that I was doing Java + Spring Boot development in VS Code so I thought I would put a video together to show it off. 

In this video, I will create a new Spring Boot Project in Visual Studio Code. Then we will add a REST API controller that our front end project can talk to. Finally, we will create a simple Vue project that talks to our Spring Boot backend. 


Here is the video along with the extensions you should install.

{% youtube 5mpHejytgFE %}

Extensions:
https://marketplace.visualstudio.com/items?itemName=Pivotal.vscode-boot-dev-pack
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack

Anyone else using Visual Studio Code for Spring Development? Are you facing any issues, got any tips?
GitHub: In Case of Apocalypse, Open This Arctic Code Vault after 1000 years in Svalbard + GH Mobile App
Tags: github, git, opensource, career
Published: 2019-11-14 14:04:33

In Case of Apocalypse, Open This Arctic Code Vault which is based in Svalbard, Norway; the end of the earth! 😰 :snowflake: :snowman:

The GitHub Arctic Code Vault is a data repository preserved in the Arctic World Archive (AWA), a very-long-term archival facility 250 meters deep in the permafrost of an Arctic mountain. The archive is located in a decommissioned coal mine in the Svalbard archipelago, closer to the North Pole than the Arctic Circle. GitHub will capture a snapshot of every active public repository on 02/02/2020 and preserve that data in the Arctic Code Vault.

GitHub will save the data for 1000 years and they are researching to reach 2000 years :rose:

Here is the official trailer of GitHub Arctic Code Vault.

{% youtube fzI9FNjXQ0o %}

GitHub CEO Nat Friedman went to Svalbard to see the infrastructure himself and the full documentary can be seen here -

{% youtube nIKrG3-WpAk %}

Also, GitHub is gonna launch Mobile Apps for Andoird and iOS :sunglasses:

{% twitter 1194675248047616000 %}

They allowed free private repos few months which was awesome! Now they are doing all these!
Seems like GitHub is going insane :smile:

What do you think?


Cheers! :wave:


As I am trying to contribute contents on the Web, you can buy me a coffee for my hours spent on all of these ❤️😊🌸
<a href="https://www.buymeacoffee.com/destromas" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
My DEV feature wishlist 🌠
Tags: meta
Published: 2019-11-14 10:01:11

## Scheduled Posts
It is a Friday and I have finished writing the week's segment of [📚 Awesome links from dev.to and around the web](https://dev.to/kudapara/amazing-links-from-dev-to-and-around-the-web-1-48ck). I'm done revising and saved the draft and everything is ready to go.

Now Saturday comes, when it is scheduled to go live to all the amazing folk on on this platform. I'm full of excitement and I'm ready to hit the `publish` button, but alas there is no electricity and no internet connectivity (💡 Fun fact: electicity is not available from 5am to 9pm, here in Zimbabwe, everyday, but randomly comes back during the day, during weekends).

My heart sinks in despair - "But I promised these people I would deliver them awesome curated links every Saturday, how am I going to do that now 😭", I say to myself.

And then a bright idea strikes my mind 🤯, the week's segment is finished and ready to go, it's already on the DEV servers, so what if there was a way I could have scheduled the post to be automatically submitted on a specific time that would have saved me so much headache.

## Post templates/Ability to clone Posts
For the past 5 weeks I have been religiously posting curated links of interesting things I have found around the web under the series [📚 Awesome links from dev.to and around the web](https://dev.to/kudapara/amazing-links-from-dev-to-and-around-the-web-1-48ck) every Saturday.

The first three posts I would hand craft every heading and structure of the Post. But after that I realized I was repeating myself so much so I made a draft post that served as a template ([The draft template, if you are interested in seeing it](https://dev.to/kudapara/awesome-links-from-dev-to-and-around-the-web-3-1o5g-temp-slug-9085729?preview=3d95a3e19f5fe070b2bd0f02b719c08be943f01b2a0923177bec5c67b5d5ce67a8eaa60154c6faa383bb7d8d77eb9c01dd17b4ee77ce6ed17ac69070)).

Now things became a lot easier. Every time I would create a new segment, I would simply copy all the text in the draft post into the new one and walaah it all works magically. Until one day I forgot to enter the series name (I am using Version 2 of the editor), which I discovered on a Monday that there was this segment of the series, just floating alone and not connected to it's related posts.

I quickly fixed it, and that got me thinking again, what if there was a way to clone an existing post, with all of its metadata, in a single click, wouldn't that be awesome?


## Conclusion

So yeah these are the 2 features that i think would really improve my workflow on the DEV platform. They may not be applicable to everyone but I'm sure there's a certain group of DEVers who would be interested. I'm still leveling up my rails skills, and at this point I do not think I have the competency to implement this so this is a cry for help to anyone interested in making this happen

Cheers 🥂
[@kudapara](https://twitter.com/kudapara)