teleren/devto huggingface dataset:
Wallbase inspired search
Tags: codepen, css, html, animation
Published: 2020-09-29 18:47:40

<p>Wallbase inspired searchbox</p>

Search box inspired by wallbase.cc, wallpaper website I used to admire back in the day, I didn't know how to make this effect. today for some reason I remembered about it and pulled the old site from archives to reverse engineer. I think I came up pretty close to what I wanted.

{% codepen https://codepen.io/sohrabzia/pen/rNebEpq %}
Hackernews clone...but for cloud news!
Tags: showdev, webdev, news, devops
Published: 2020-09-29 18:44:36

Hello everyone on DEV! 

I'm really excited to share a project I completed with you all called 

### [Cloud Weekly ... News!](https://CloudWeekly.News)


It's a news aggregator for all things related to "The Cloud"

It features news from the big three cloud vendors 
* AWS
* Azure
* GCP

As well as posts from the DEV.to community! Any posts that are cloud and devops specific get shared to the larger community and the traffic is brought back to you, the post writers.

I hope some of you will take a look and give me some feedback!

I look forward to seeing what more of you write and share with the world!
Python the new gold rush
Tags: python, webdev, productivity
Published: 2020-09-29 18:38:11

Up-recently there has been urge for midlevel IT professionals to know Python and put it in thier resume. Python was there long even before Java was born and why this sudden rush 

1) Beginner Friendly Program

When I was learning introductory program in my graduate days it was C to start with but nowadays people start with python in thier college days. 
Thanks to it's less confusing syntax style way of design and more towards problem solving tool kind.

2)King of Data Science 

Python huge popularity is due to it's no upper limit of its data type. So as data science picked this language is natural choice as it can handle any amount of data whereas c and java has thier limits on upperbound. 

3)Python in AI, ML

Latest evolving fields in computer has used python as their language and framework for Artificial intelligence and Machine learning available in python makes it as future proof skill. 

4) Python in web application framework

Not only as future proof the most hot area of present  web application development and for building that microservice based rest application python has Django framework that is popular.Apart from that there is Flask ,a microframework for simple application. 

5) Python in embedded and IOT devices like Raspberry Pi

Not only used by computer people even python find it's way to be used in electronics field. 

6) Python as utilties script

The biggest strength of python is it not only limit itself in big future proof areas even for small things it can be used like batch scripts, scheduler, automating boring stuffs in computer, automation testing language of selenium etc

To summarize the gold Rush was due to it's inborn design

_Easy syntax
_Less learning curve
_Framework for all popular and future areas in computer science
_Community support
_Great market demand as one language unlimited possibilities. 
_As more people involve in python learning more diverse set of tools in different areas started coming and that makes the rush even more. It is unstoppable. 

Ps:If you want to add some more to the list feel free to comment below.
A cutting-edge integration of blockchain and gaming
Tags: blockchain, python
Published: 2020-09-29 18:35:31

Binary Options is one of the relatively new asset trading services, and it has certainly gathered a huge number of followers over the last few years. The integration of blockchain technology in a binary options trading framework eliminates any concerns about fraud. Bulls vs. Bears is a blockchain-based binary options trading platform that uses Tronix (TRX) crypto as the main digital currency for making trades, where players can trade on 30-second candles. We helped the Bulls vs. Bears team develop this safe betting platform from scratch.

https://evrone.com/bulls-vs-bears
How we helped a tech leader build an automated healthcare app for care teams
Published: 2020-09-29 18:35:19

Evrone focuses on using proven technologies to complete intricate, high-load projects for large enterprises and facilitate fast start-up launches. Our engineers closely monitor advances in technology and apply the innovations that show the most convincing results. This approach led Evrone to expand our tech stack to include the Dart programming language and the Flutter framework, both of which we employed in the development of a healthcare mobile app for our client.

https://evrone.com/medcorder
New infrastructure and management for an investment platform
Published: 2020-09-29 18:35:04

Potok is a crowdfunding platform for lending and investments for medium and small businesses. It allows small businesses to quickly attract loans from investors, individuals and legal entities, while they receive equally fast returns.

The platform was launched as an Alfa Bank project back in 2015, but in 2019, the bank sold a 40% stake to a group of private investors with experience in the development of fintech projects.

The platform is written in Ruby on Rails, so the new shareholders approached Evrone, since we are experts in this technological stack, with the task of managing the development and support of an innovative product.

https://evrone.com/potokdigital
Day 1 with the Github CLI 1.0
Tags: github, git, opensource, news
Published: 2020-09-29 18:30:41

Originally posted on my [blog](https://pradipta.github.io/day-1-with-the-github-cli)

GitHub finally launch their CLI, versioned 1.0 after 7 months of having it in Beta. Done with `Cmd+Tab` / `Ctrl+tab` to move to the browser. Do it all at one place.

You can install the GitHub CLI on you laptop and can perform entire GitHub's workflow right from the terminal, starting from creating an issue, reviewing a PR, to merging a PR.

You can create aliases against any commands.
You can also use GitHub APIs to trigger Actions.

Visit this [link] (https://cli.github.com/) for the official documentation.

To install Github CLI, open the terminal and run:

`brew install gh` [Mac]

`sudo apt-add-repository https://cli.github.com/packages && sudo apt update && sudo apt install gh` [Linux]

`scoop bucket add github-gh https://github.com/cli/scoop-gh.git` [Windows]

![brew install gh](https://dev-to-uploads.s3.amazonaws.com/i/z1wq21q0yo7evpyq4zif.png)

![gh help](https://dev-to-uploads.s3.amazonaws.com/i/zy7e6sezp7u8rnojy6u1.png)

After the installation, we need to authenticate the CLI with our GitHub Account. For that, run `gh auth login` and proceed with the instructions that follow.

![gh auth login](https://dev-to-uploads.s3.amazonaws.com/i/eop95e9ycn3qw8lpmun9.png)

On a successful login, we now can perform all the workflows of GitHub, for which, previously, we had to open the browser, right from the terminal.

Let's look at some of them.

`gh repo clone <repo name>`
![gh repo clone](https://dev-to-uploads.s3.amazonaws.com/i/9fwa2iojsylsx41fop1y.png)

A `gh repo view` would show us the Readme for the repo, if any.

We can create an issue on a repo using `gh issue create` and entering the details that it asks for.

![gh issue create](https://dev-to-uploads.s3.amazonaws.com/i/qu01e78m7m6jdv6lsahp.png)

I created a new branch and made some changes, commited them and pushed it to the branch. To raise a PR, I previously had to go to GitHub.com on my browser and raise it from there. No more. All you need is: `gh pr create`

![gh pr create](https://dev-to-uploads.s3.amazonaws.com/i/l3qneg20bxti073oyfn9.png)

We can also perform PR reviews from the CLI. I haven't tried out reviewing a big PR on it to put my thoughts about it. But yes, we can. We can approve, leave comments, or request for changes right from the CLI.
![gh pr approve](https://dev-to-uploads.s3.amazonaws.com/i/oivdbcalve17u5o22ha6.png)

Also, have it merged.
![gh pr merge](https://dev-to-uploads.s3.amazonaws.com/i/c9thjrls6142q4mwe1p6.png)

This is just an overview, there are a whole lot of commands we need to play around and try out.

One of the best things: to create a new repo, we donot need to do a `git init`, Create Repo on GitHub.com, and `git remote add origin ...`. It is just a command on the CLI.

Happy Git!
The 5 minute cluster
Tags: docker, ansible, devops
Published: 2020-09-29 18:22:59

```bash
ansible-playbook -i hosts swarm-bootstrap.yml  61,38s user 14,61s system 25% cpu 5:00,57 total
```

Being a DevOps enthusiast I am always looking forward to testing and studying new tech as I discover them. On top of that being a Linux user for more than 20 years has made me savvy to know how stuff work to the very basic.

This time I wanted to build and play around with a docker-powered cluster. Initially the idea was to play around with Kubernetes but it's a beast I am yet to tame. So I moved to a simpler solution: docker swarm.

Inspired by [Docker Swarm Rocks](https://dockerswarm.rocks/) site and a [Digital Ocean's Guide](https://www.digitalocean.com/community/tutorials/how-to-create-a-kubernetes-cluster-using-kubeadm-on-ubuntu-18-04), I created a set of [ansible](https://github.com/ansible/ansible) playbooks that automate the process of installing and configuring the cluster including [Traefik](https://traefik.io/traefik/) as reverse proxy, [Portainer](https://www.portainer.io/) as container manager and [Jenkins](https://www.jenkins.io/) as an automation server.

To run this you will need, first, a set of Linux Servers (VM or Bare Metal). You should have ansible installed, and ssh access to each of these servers. In my case I used Google Cloud Platform's Instances to do all the testing.

Once you have all your servers set up, including ssh access to them, clone the [repo](https://github.com/rodrigoegimenez/ansible-docker-swarm-cluster) to your local machine,

```bash
git clone https://github.com/rodrigoegimenez/ansible-docker-swarm-cluster.git
cd ansible-docker-swarm-cluster
```

Add your servers info to the `hosts` file, and finally run the main playbook,

```bash
ansible-playbook -i hosts swarm-bootstrap.yml
```

sit back and relax. When installing the services ansible will ask you questions like the domain to use (ie. traefik.yoursite.com) and credentials for some of these services. Make sure you are pointing these domains to the master node of your cluster.

In 5 minutes you'll have your cluster up and running and ready to deploy more and more services to.

That's it!

<small><span>Photo by <a href="https://unsplash.com/@tumbao1949?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">James Wainscoat</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span></small>
Leetcode #234 - Palindrome Linked List
Tags: javascript, algorithms
Published: 2020-09-29 18:20:52

---
title: Leetcode #234 - Palindrome Linked List
published: true
description: 
series: Algorithms
tags: javascript, algorithm
---

_Problem: Given a singly linked list, determine if it is a palindrome._

## Method 1: Create an array of values
The structure of a linked list doesn't provide access to the total size of the list. To get around this we can iterate over the list and push the node values on to an array. At that point we have access to the array's length and can use a single pointer `i` to compare values opposite to eachother in the array.

```js
var isPalindrome = function(head) {
    let values = []
    // push all node values into an array
    while (head !== null) {
        values.push(head.val)
        head = head.next
    }
    // iterate over array and compare values
    for (let i = 0; i < values.length >> 1; i++) {
        // (values.length - i - 1) is our virtual pointer
        if (values[i] !== values[values.length - i - 1]) return false
    }
    return true
};
```
The time and space complexity of this method are `O(n)`

## Method 2: Reverse the Second Half in Place
We can use a `fast` and `slow` pointer to get to the center and the end of the list, respectively. Once we are able to determine the center, we use the `slow` pointer to re-link the second half of the list in reverse. I like to conceptualize this method as taking a snake and turning its tail into a head, resulting in a two headed snake with a tail (ListNode.next = `null`) in the middle.

```js
var isPalindrome = function(head) {
    if (head === null || head.next == null) return true
    let slow = head
    let fast = head
    
    while (fast !== null && fast.next !== null) {
        fast = fast.next.next
        slow = slow.next
    }
    // if list length is odd, move slow over one to start
    // the second half of the list
    if (fast) {
        slow = slow.next
    }
    
    // reverse the second half of the list
    slow = reverse(slow)
    fast = head
    
    // check for palindromicity
    while (slow) {
        if (slow.val !== fast.val) {
            return false
        }
        slow = slow.next
        fast = fast.next
    }
    return true
}

function reverse(head) {
    let prev = null
    let next;
    while (head) {
        next = head.next
        head.next = prev
        prev = head
        head = next
    }
    return prev
}
```
The time complexity is `O(n)` and space complexity is `O(1)` as we are not creating any extra arrays.
Serif vs Sans-serif vs Monospaced
Tags: html, css, beginners, webdev
Published: 2020-09-29 18:16:41

**Serif, Sans-serif, and Monospaced are categories of 'types of fonts'.** 

*Serif-*
     -The letters and characters end in strokes.
     -Serif fonts are usually used in paragraphs or bodies which 
      make use of small text as it is easily readable.
     -You'll see Serif fonts in the body of a newspaper article

*Sans-serif-*
     -The letters and  characters are plain and don't have strokes 
      at the end. 
     -Sans-serif is usually used in places where you want to make 
      the text stand-out
     -You'll see this type of font in the title of a newspaper 
      article
*Monospaced-*
     -In Monospaced fonts each letter and character have the same 
      width. i.e they occupy the same amount of horizontal space.
     -These kinds of fonts are usually seen in command lines.

*There may be exceptions*
Trying to run echo server in Minikube with Istio getting connection refused from client socker

Tags: kubernetes, istio, cpp
Published: 2020-09-29 18:05:27

I have a simple echo server (protocol TCP) written in CPP. I am able to put the server in docker container and with port mapping it works. So I think my client server are OK. When I upload the server image in Kubernetes and deploy Istio with ingress Gateway listening on port 31400 which I think is the right one when using tcp I get connection refused from client trying to connect to the socket.
'''apiVersion: apps/v1
kind: Deployment
metadata:
    name: tcp-echo-deployment
    labels:
        app: tcp-echo
        system: example
spec:
   replicas: 1
   selector:
      matchLabels:
              app: tcp-echo
       template:
          metadata:
             labels:
                    app: tcp-echo
                    system: example
          spec:
            containers:
            - name: tcp-echo-container
              image: igordptx/my-tcp-server
              imagePullPolicy: Always
              env:
              - name: TCP_PORT
                value: "2701"
              - name: NODE_NAME
                valueFrom:
                  fieldRef:
                    fieldPath: spec.nodeName
              - name: POD_NAME
                valueFrom:
                  fieldRef:
                    fieldPath: metadata.name
              - name: POD_NAMESPACE
                valueFrom:
                  fieldRef:
                      fieldPath: metadata.namespace
              - name: POD_IP
                  valueFrom:
                   fieldRef:
                      fieldPath: status.podIP
              - name: SERVICE_ACCOUNT
                valueFrom:
                   fieldRef:
                      fieldPath: spec.serviceAccountName
                ports:
                   - name: tcp-echo-port
                     containerPort: 2701'''
'''
apiVersion: v1
kind: Service
metadata:
        name: "tcp-echo-service"
        labels:
                app: tcp-echo
                system: example
spec:
        selector:
                app: "tcp-echo"
        ports:
                - protocol: "TCP"
                  port: 2701
                  targetPort: 2701
'''
'''
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
        name: echo-tcp-gateway
spec:
        selector:
                istio: ingressgateway
        servers:
        - port:
                number: 31400
                name: tcp-echo
                protocol: TCP
          hosts:
              - "*"


apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
        name: tcp-echo-vs-from-gw
spec:
        hosts:
             - "*"
        gateways:
             - echo-tcp-gateway
        tcp:
             - match:
                        - port: 31400
               route:
                        - destination:
                                 host: tcp-echo-service
                                 port:
                                        number: 2701
'''
What is the minimum...
Tags: webdev, javascript, career
Published: 2020-09-29 18:04:56

Hello all, 

I would like to hear from both junior and senior level developers on what are the minimum programming skills needed to become a developer.  I am looking for more than just the basic answers, "Know HTML, CSS, JavaScript, Git, Node, etc.".  We can Google everything, so what do you need to know without Googling?  I am looking for specific level of knowledge needed.

Thank you all in advance.
at() on built-in indexables
Tags: javascript
Published: 2020-09-29 17:52:50

You might have tried to access the last element in array using `arr[arr.length-1]` and wondered if we had support for `[-indx]` [negative-index](https://h3manth.com/new/blog/2013/negative-array-index-in-javascript/) but the same wouldn't apply for `String` and `TypedArrays` as `-indx` would be a property on them rather than the index.

Hence we have [`item()`](https://github.com/tc39/proposal-item-method) a proposal on stage-3 is a method on the prototype of the built-in indexable objects: `Array`, `String`, and `TypedArrays` objects, it also supports relative indexing from the end when passed a negative index.

__Let us look into few examples:__

```js
let nums = [1,2,3];

nums.at(0); // 1

nums.at(-1); // 3

nums.at(100); // undefined
```

```js
let name = 'ECMA';

name.at(0); // "E"

name.at(-1); // "A"

name.at(100); // undefined
```

```js
let unit8 = new Uint8Array([1,2,3]);
unit8.at(0); // 1

unit8.at(-1); // 3

unit8.at(100); // undefined
```

`indx` will be converted to `0` for `NaN`, `null`, `+0`, `-0` or `undefined`

If this proposal gets adopted, the following legacy interfaces should be upgradable into `ObservableArray`:

* [NodeList](https://dom.spec.whatwg.org/#nodelist)
* Possibly [DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist) as a subclass
* [CSSRuleList](https://drafts.csswg.org/cssom/#cssrulelist)
* [StyleSheetList](https://drafts.csswg.org/cssom/#stylesheetlist)
* Possibly [CSSStyleDeclaration](https://drafts.csswg.org/cssom/#cssstyledeclaration) and [MediaList](https://drafts.csswg.org/cssom/#medialist), as subclasses
* [FileList](https://w3c.github.io/FileAPI/#dfn-filelist)

__Update:__

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">It&#39;s worth noting that YUI 2/3 duck-typing on `item()` means that we&#39;ll need a different name for web compat reasons. <a href="https://twitter.com/_shu?ref_src=twsrc%5Etfw">@_shu</a> suggested `at()`</p>&mdash; Alex Russell (@slightlylate) <a href="https://twitter.com/slightlylate/status/1326944308826550272?ref_src=twsrc%5Etfw">November 12, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
josk@next
Tags: news, javascript, node, mongodb
Published: 2020-09-29 17:45:07

We build and use JoSk to help manage tasks across cluster and Node.js multi-server infrastructure. 

Best use-case is running repetitive jobs/tasks by the same codebase on multi-server infrastructure, usually repetitive tasks should get executed only once at the time, but that's not the case when running distinct codebase instances, most probably task would get called by each instance.

JoSk goal is to balance repetitive jobs across multi-server infrastructure, and to make sure each task got executed only once at the time.

While perfect solution would be is to implement and run independent tasks queue micro-service server, but on high load with need to distribute and balance tasks execution you will end up with similar solution.

Last release changelog is [available here](https://github.com/VeliovGroup/josk/releases/tag/2.3.0)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/b6t7r5o3toty7qnm5yd1.jpg)
Why did you decide to pursue a career in tech?
Tags: discuss, codenewbie
Published: 2020-09-29 17:43:58

Hi everyone 👋🏽—

I've been in tech eight years and one thing is abundantly clear: everyone has a story as to why they're now in a tech career. 

Whether you come from a non-traditional background or majored in Computer Science (or another computing discipline), why did you decide to pursue a career in tech? What do you like most about being in tech?
Javascript ||, aka Why Doesn't This Work?!
Tags: javascript, webdev, productivity, beginners
Published: 2020-09-29 12:23:17

---
title: Javascript ||, aka Why Doesn't This Work?!
published: true
description: I and others constantly want this expression to work and it doesn't, why?
tags: javascript, webdev, productivity, beginners
canonical_url: https://laurieontech.com/posts/or-expressions/
---

There is a piece of JavaScript syntax I, and others, seem to always want to work and it doesn't. 

```javascript
const isThisOrThat = "that" === ("this" || "that")
// this is false
```

Why doesn't this work? Let's talk about it!

## Inside the parens

If we go by order of operations, the inside expression evaluates first.

What does `"this" || "that"` mean in JavaScript? 

I'll be honest, this one breaks my math brain a bit. In math, `a || b = b || a`. The or operator is commutative, so order doesn't matter. That's not true in JavaScript, order matters a lot.

Let's look at two examples.

```javascript
const example = "" || "that"
// "that"
```

The first thing JavaScript does is check for the "existence" of the first value. JavaScript is checking for a falsey value, empty string is falsey. Since the first value doesn't exist, it returns the second value.

This happens even if the second value is also falsey.

```javascript
const example = "" || ""
// ""
```

So what happens if the first value is truthy, as in our original example?

```javascript
const example = "this" || "that"
// "this"
```

`example` evaluates to `"this"`. 

### Equality check

Now we start to realize why our expression up top doesn't work. We can break it into two pieces.

```javascript
const example = "this" || "that"
const isThisOrThat = "that" === example
// false
```

At the time that we're checking equality, the string `"that"` is nowhere to be found. 

What makes this strange is that order matters.

```javascript
const example = "that" || "this"
const isThisOrThat = "that" === example
// true
```

Flipping the original or expression changes the resulting equality check.

### Making sure this works

If we truly want to check both strings, we need to check equality twice.

```javascript
const isThisOrThat = "that" === "this" || "that" === "that"
// true
```

Alternatively, we can use an array check. This one feels a bit more natural.


```javascript
const isThisOrThat = ["that", "this"].includes("that")
// true
```

## Or is weird

People use or a lot to flip values or set defaults, etc. It's never been my favorite because of examples like the ones above. Once you start composing that expression it can confuse the issue.