teleren/devto huggingface dataset:
Around the Web – 20190201
Tags: blog
Published: 2019-02-16 15:25:38

---
title: Around the Web – 20190201
published: true
tags: Blog
canonical_url: https://wipdeveloper.com/around-the-web-20190201/
cover_image: https://wipdeveloper.com/wp-content/uploads/2017/07/WIPDeveloper.com-logo-black-with-white-background.png
series: Around the Web
---

And now for somethings to read (or watch) over the weekend, if you have some spare time that is.

## [204: Billionaires Making It Up](https://www.gooddaysirpodcast.com/podcast/2019/1/30/204-billionaires-making-it-up)

**Good Day, Sir! Show – Salesforce Podcast**  – / John De Santiago – Jan 30 – In this episode, we discuss queueables and integrations, startup hustle culture, Apple’s financials, HackerRank 2019 Developer Survey, Microsoft’s financials, and compile woes.

## [Lightning Web Components Video Gallery](https://developer.salesforce.com/tv/lwc-video-gallery)

**Salesforce.com**  – Watch these bite-sized videos, and learn how Lightning Web Components help you build high-performance, Aura-compatible code using modern web standards.

## [Google Play Store now open for Progressive Web Apps](https://medium.com/@firt/google-play-store-now-open-for-progressive-web-apps-ec6f3c6ff3cc)

**Medium**  – Maximiliano Firtman – Jan 31, 10:42 AM – Chrome 72 for Android shipped the long-awaited Trusted Web Activity feature, which means we can now distribute PWAs in the Google Play Store! I played with the feature for a while, digging into the APIs and here you have a summary of what’s going…

## [HTML, CSS and our vanishing industry entry points](https://www.rachelandrew.co.uk/archives/2019/01/30/html-css-and-our-vanishing-industry-entry-points/)

**rachelandrew.co.uk**  – Jan 30, 5:32 AM – A low traffic email list, keep up to date with where I am and what I’ve published. Everyone is angry about CSS again. I’m not even going to try to summarize the arguments. However it always seems to boil down to the fact that CSS is simultaneously…

## [Future JavaScript: what is still missing?](http://2ality.com/2019/01/future-js.html)

**2ality**  – In recent years, JavaScript has grown considerably in size. This blog post explores what’s still missing. I’m only listing the missing features that I find most important. Many others are useful, but there is also a risk of adding too much. My…

## Till Next Week

Want to share something? Let me know by leaving a comment below or emailing [brett@wipdeveloper.com](mailto:brett@wipdeveloper.com)  or following and tell me on [Twitter/BrettMN](https://twitter.com/BrettMN).

Don’t forget to sign up for **[The Weekly Stand-Up!](https://wipdeveloper.com/newsletter/)** to receive free the [WIPDeveloper.com](https://wipdeveloper.com/) weekly newsletter every Sunday!

The post [Around the Web – 20190201](https://wipdeveloper.com/around-the-web-20190201/) appeared first on [WIPDeveloper.com](https://wipdeveloper.com).
How would you build a full stack Node.js web app today?
Tags: discuss, node, javascript
Published: 2019-02-01 16:46:27

---
title: How would you build a full stack Node.js web app today?
published: true
description: Looking for suggestions from backend to front-end.
tags: discuss, node, javascript
---

If you were to start a new web project with Node.js today, how would you pick your stack? I'm looking for suggestions spanning both backend and front-end. Thanks!
Elegant matcher for multiple method call expectations
Tags: ruby, rspec
Published: 2019-02-01 16:41:15

---
title: Elegant matcher for multiple method call expectations
published: true
description: Matching multiple method calls may be a bit overwhelming. It would be great to have it covered elegantly.
tags: ruby, rspec
---
![Boilerplate and his team](https://thepracticaldev.s3.amazonaws.com/i/oq39jgyy7bypwlx3xizm.jpg)
Recently, I was digging through some test code and found an annoying recurring pattern that is somehow clumsy and unsatisfying. I talk about such a case:
```ruby
  expect(user.uid).to eq('hpqeqa12asdq1')
  expect(user.country).to eq('Germany')
  expect(user.street_number).to eq('9')
  expect(user.street_address).to eq('Somestrasse')
  expect(user.balance(from: 1.week.ago)).to eq(42000)
```
When you look at that wall of code you see some recurring pattern that is blazing before your eyes blocking you from seeing the essence. It is `expect(user.***).to eq(...` every time. This block does not bring much value into the expression and simply is boilerplate. Although, one might say that such test cases do not comply to the meaning of well-written specs because they do test multiple things at once, but this is not a case of bad code. It checks values that were most likely atomically inserted in one step, so having them tested separately is a waste of time and more boilerplate code that does not make understanding presumed assertions easier to grasp. I was thinking over the way to make such an expression more data-driven and less cluttered with noise. This is what I came up with as a result:
```ruby
### Implementation ###

def expect_responses(object, **fields)
  fields.reduce(true) do |acc, (field, expectation)|
    acc && if expectation.is_a?(WithArguments)
              object.send(
                field, 
                *expectation.arguments
              ) == expectation.expected_result
           else
             object.send(field) == expectation
           end
  end
end

WithArguments = Struct.new(:arguments, :expected_result)

def with_arguments(*args, to_have_result:)
  WithArguments.new(args, to_have_result)
end

### Example ###

expect_responses(
  user,
  uid: "hpqeqa12asdq1",
  country: "Germany",
  street_number: '9',
  street_address: 'Somestrasse',
  balance: with_arguments({from: 1.week_ago}, to_have_result: 42000)
) # => true
```

This one seems cleaner, and also I've added a way of passing arguments into the method. To make is easier to grasp for this post, this code returns a boolean value and uses simple comparison, in the real RSpec code it would run on expectations and use matchers to properly compare composite data structures. I tried to mimic common style of RSpec DSL, but I am not really sure on naming of this composite assertion `expect_responses` seems to be alright, but if you may suggest something better on this topic or any part of this post - leave a comment below. Would you find such an addition to RSpec worthy? Would you use it? Why? Why not?
List IPs from CloudTrail events
Tags: cloudtrail, cli, aws, bash
Published: 2019-03-22 15:50:17

---
title: List IPs from CloudTrail events
published: true
tags: cloudtrail, CLI,aws,bash
canonical_url: https://deeb.me/20190201/list-ips-from-cloudtrail-events
---

A quick command to list the IPs from AWS CloudTrail events.

```
#!/bin/bash ACCESS\_KEY\_ID=AKIASMOETHINGHERE MAX\_ITEMS=100 aws cloudtrail lookup-events --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=${ACCESS\_KEY\_ID} --max-items ${MAX\_ITEMS} \ | jq -r '.Events[].CloudTrailEvent' \ | jq '.sourceIPAddress' \ | sort | uniq
```

This of course can be extended to include more information, for example:

```
#!/bin/bash ACCESS\_KEY\_ID=AKIASMOETHINGHERE MAX\_ITEMS=100 aws cloudtrail lookup-events --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=${ACCESS\_KEY\_ID} --max-items ${MAX\_ITEMS} \ | jq -r '.Events[].CloudTrailEvent' \ | jq '{ User: .userIdentity.userName, IP: .sourceIPAddress, Event: .eventName }'
```
What's your favourite CI/CD tool and why?
Tags: discuss, opensource, devops
Published: 2019-02-01 16:06:01

---
title: What's your favourite CI/CD tool and why?
published: true
description: a short thread on favourite CI/CD systems in dev.to community
tags: discuss, meta, opensource, devops
---

Throughout the years I have seen many companies using different tools to achieve same/similar things in CI/CD area. There's no denying that [Jenkins](https://jenkins.io/) is probably the most widely used solution due to the huge amount of available integrations and plugins. There are, however, some downsides such as resource consumption that can become very expensive at scale. I always remember this great article from Monzo [Building a Modern Bank Backend](https://monzo.com/blog/2016/09/19/building-a-modern-bank-backend/) that was mostly about migrating from Mesos to Kubernetes, but it does have some important points such as:

>  Previously, we ran several very beefy Jenkins hosts dedicated to the task, which were inefficient and expensive. Now, build jobs run under Kubernetes, using spare capacity in our existing infrastructure, which is basically free. - *Oliver Beattie*

Similar issues I have noticed in other companies, such as disks getting full due to growing workspaces or just agents getting quite slow due to insufficient host resources. Most of these issues could be labelled as user configuration problem, but then it seems that they don't exist in other systems. 

My favourite tools to automate tasks:

- [Google Cloud Build](https://cloud.google.com/cloud-build/) - powerful and cheap alternative to CircleCI/Travis. If you are running on GCP, I would definitely recommend looking into it as for most users it will be running for free :0
- [Gitlab CI/CD + runners](https://docs.gitlab.com/runner/). A great model, probably designed based on drone.io server/agent model. Nevertheless, works great most of the time :) 
- [Drone](drone.io) - very lightweight solution that you can run even on your desktop or on any server. Pipelines are defined in the same repo as your code and all builds happen in containers, so no issues with dirty workspaces or tying them to individual hosts. 


It would be interesting to know what tools other people are using and why, please write your answer in the comments! :)
Do you store your local development config in the cloud?
Tags: discuss, productivity
Published: 2019-02-01 15:54:03

I'm currently traveling and working off my _other_ laptop. My main computer is now a desktop machine.

My question is: What do you do to share your development configuration between devices? Specifically both of my computers are macs. I'm interested in specific technology I can be using to help with this, in addition to general discussion around this topic.

Thanks!
Fix unexpected scroll jump - Vue Router
Tags: vuerouter, scrolljump, scrollbehavior, vue
Published: 2019-02-01 15:53:59

---
title: Fix unexpected scroll jump - Vue Router
published: true
description: Fix unexpected scroll jump behavior on modern browsers on history mode with Vue Router
tags: vue-router, Vue Router, scroll jump, scrollBehavior, VueJS, Vue
---

You may have noticed a breaking change in scroll behavior in modern browsers called [scrollRestoration](https://developer.mozilla.org/en-US/docs/Web/API/History) while using [Vue Router](https://router.vuejs.org/).

It is an awesome feature that allows the browser to jump back to the previously saved scroll location with a JS script based routing.

Unfortunately, it conflicts with the Vue Router implemented methods [scrollBehavior](https://router.vuejs.org/guide/advanced/scroll-behavior.html#scroll-behavior).

If you have no `<transition/>` on your `<router-view/>` you might not see any difference with the old behavior.
But if you are using it, especially leave transition, the page scroll jumps back to top at the start of the transition when you navigate to a new page.

The solution is to set [scrollRestoration](https://developer.mozilla.org/en-US/docs/Web/API/History) to `manual`, so the browser doesn't try to handle the behavior in your place.

```javascript
if ('scrollRestoration' in window.history) {
  window.history.scrollRestoration = 'manual';
}

```

Source: [History API: Scroll Restoration](https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration) by Paul Lewis
Concurrency and parallelism are two different things
Tags: concepts, programming
Published: 2019-02-01 15:05:23

---
title: Concurrency and parallelism are two different things 
published: true
description: It may seem that there is no difference between concurrency and parallelism, but this is because you did not understand the essence of the matter. 
tags: concepts, programming
cover_image: https://thepracticaldev.s3.amazonaws.com/i/md2fqxgi7z3ajry5p8my.jpg
---

It may seem that there is no difference between concurrency and parallelism, but this is because you did not understand the essence of the matter. Let's try to understand how they differ.

![Concurrency](https://thepracticaldev.s3.amazonaws.com/i/8f3zjkawp05r0twten12.jpg)

**Concurrency** is the execution of more than one task is being processed at a time inside the application. An important detail is that tasks are **not necessarily performed at the same time**(but it's possible), so they can be divided into smaller and alternating ones. In this case, threads can be physically executed simultaneously, but this is not necessary.

Tasks are not connected with each other. Therefore, it does not matter which of them will end earlier, and which later. Thus, concurrency can be realized in many ways — using green threads or processes or asynchronous operations that work on one CPU or something else.

Let's draw an analogy: the secretary answering phone calls and sometimes checks the appointments. He needs to stop answering the phone in order to go to the desk and check for appointments, and then start answering and repeating this process until the end of the workday.

As you have noticed, concurrency is more connected with logistics. If it were not, then the secretary would wait until the time of the appointment and do necessary things and then go to the ringing phone.

![Parallelism](https://thepracticaldev.s3.amazonaws.com/i/ud0jwm4258tke84sbct8.jpg)

**Parallelism** is the execution of tasks at the same time (for example, there are 5 tasks, each of them is completed within 60 minutes). The name itself implies that they are executed in parallel. Parallelism is one of the ways to implement concurrent execution by highlighting the abstraction of the worker thread or process. Also for parallelism to be true there have to be at least two CPU cores.

Back to the office: now we have two secretaries. One watches the phone and the other set up appointments. Work is divided because now there are two secretaries working in the office.

Parallelism is a subclass of concurrency: before performing several simultaneous tasks, you must first organize them correctly.

I also advise you to go read/see [Rob Pike](https://blog.golang.org/concurrency-is-not-parallelism).

------

**Thank you for reading!**

Any questions? Leave your comment below to start fantastic discussions!

Check out [my blog](https://luminousmen.com/) or come to say hi 👋 on [Twitter](https://twitter.com/luminousmen) or subscribe to [my telegram channel](https://t.me/iamluminousmen).
Plan your best!
Progressively enhanced menu buttons with details/summary
Tags: a11y, javascript, pe
Published: 2019-02-01 15:00:51

---
title: Progressively enhanced menu buttons with details/summary
published: true
description: "Menu button/dropdown functionality without JavaScript"
tags: a11y, javascript, PE
canonical_url: https://marcus.io/blog/progressive-enhanced-menus-details-summary
---

While researching for the [accessible approach to menu buttons in Vue](https://marcus.io/blog/a11y-app-menu-button) this week, I couldn't help myself but to open my browser's dev tools on every "menu button" sighting I came across, curious how the respective team or developer implemented it.

The concept of a "menu" of any kind is often found in profile dropdows. Some websites decide to not use a semantic menu at all, "just" showing a div or list on click and releasing its content into the tab order, ([dev.to, for example)](https://dev.to/).

And there is GitHub's approach that uses the details and summary element for a menu, making the whole construct work even without JavaScript ([in nearly every browser](https://caniuse.com/#search=details)). Here's the birds-eye view of their approach:

```HTML
<details>
    <summary>Click me</summary>
    <details-menu role="menu"> <!-- a custom element -->
        <li><button type="button" role="menuitem">Agnetha</button></li>
        <li><button type="button" role="menuitem">Björn</button></li>
        <li><button type="button" role="menuitem">Benny</button></li>
        <li><button type="button" role="menuitem">Anni-Frid</button></li>
    </details-menu>
<details>

```

I won't try to explain it any further - because:

* GitHub put their approach on, well, GitHub: [the `<details-menu>` custom element](https://github.com/github/details-menu-element)
* Mu-An Chiou, Web Systems Engineer at GitHub, not only [did a presentation about their technique (link to slides)](https://docs.google.com/presentation/d/1hvnPpsJo44BTPfJx28CV95vqk_dt6na1awUbk0kmZYM/edit#slide=id.p), but supplied a [*details on details* document](https://github.com/muan/details-on-details) with further links and anecdotes
* [Mu-An is approachable on Twitter, offering to chat about her approach](https://twitter.com/muanchiou/status/1091331877636661249)
Buckaroo - C/C++ Package Manager Hits v2.0
Tags: packagemanager, buildsystem
Published: 2019-02-01 14:53:19

---
title: Buckaroo - C/C++ Package Manager Hits v2.0
published: true
description: Buckaroo - The decentralized C++ package manager
tags: C++, package manager, build system
---

https://github.com/loopperfect/buckaroo
 
# Why Buckaroo?
Package managers like Yarn and Cargo have shown how productive developers can be when they can easily integrate a large ecosystem of projects. Buckaroo fills this gap for C++.


The Buckaroo workflow looks like this:

```bash
# Create your project file
$ buckaroo init

# Install dependencies

$ buckaroo add github.com/buckaroo-pm/boost-thread@branch=master
# Run your code
$ buck run :my-app
```

# Features
C++ has unique requirements, so Buckaroo is a highly sophisticated piece of software.

* Pull dependencies directly from GitHub, BitBucket, GitLab, hosted Git and HTTP
* Fully reproducible builds and dependency resolution
* Completely decentralized - there is no central server or publishing process
* Allows any build configuration (even on a package-by-package basis)
* Private and public dependencies to avoid "dependency hell"
* Multiple libraries per package, so tools like Lerna are unnecessary
* Pull individual packages out of mono-repos
* Full support for semantic versioning (but only when you want it!)
* Live at head! Move fast by depending directly on Git branches, but in a controlled way
* Blazing fast resolution using clever heuristics
* Version equivalency checks to reduce dependency conflicts
* TOML configuration files for convenient editing by computers and humans
* Works offline (with a populated cache)
* Enable Upgrade Bot to keep everything up-to-date with a single click


# Intrigued?

Head over to https://github.com/loopperfect/buckaroo
Learn blockchain with Web3Coach
Tags: webdev, career, opensource, blockchain
Published: 2019-02-01 14:36:48

---
title: Learn blockchain with Web3Coach
published: true
description: I am excited to share with you this new Twitter channel for devs focused on blockchain TECH, what is it, how to get started and master it. 
tags: webdev,career,opensource,blockchain
cover_image: https://rablater.sirv.com/LukasLukac/blocksbylukas_example.jpg
---

Hey dev.to community!

I am excited to share with you my new Twitter channel designed for developers, focused on blockchain TECH, what is it, how to get started and master it.

All my material is split into comprehensive small chunks, visual blocks and published on Twitter. Using this strategy, you can traverse advanced topics block by block even with your busy schedule and still master the concepts.

The first 2 blocks are live as of today! Voilaaa!

Block 0, genesis:

{% twitter 1091292847603703809 %}

Block 1: What is blockchain?

{% twitter 1091294546464526337 %}


If you like this structure and would love to learn more, [follow me on Twitter](https://twitter.com/Web3Coach), leave comments. All the content will be based on your feedback, completely free with the goal of improving the technical reputation of blockchain and bringing more  developers to the ecosystem.

Do enjoy the blocks!
My 2019 Goals! Not too late to Start 
Tags: 2019goals
Published: 2019-02-01 13:34:27

---
title: My 2019 Goals! Not too late to Start 
published: true 
description: How I finally decided to go big in 2019 after a dull...
tags: 2019 goals  
---
Your greatest limitation is your last achievement said one of my mentors. 2018 was great, I had a few success stories some of which I hope to discuss in another article. But this made  me take it slow towards the end of last year, forgetting that the quest for greatness has just started. 

Now, am back and invite you to join me on this 2019 journey to achieve my 10 goals for 2019: 
0. Get a new laptop 
1. Become a Badass Frontend Web Developer   
2. Become an Intern, then get a Remote Job
3. Build my portfolio website
4.  Finish @freeCodeCamp curriculum
5. Contribute to open source project
6.  Finish #100DaysOfCode & #301DaysOfCode
7. Publish an article on Dev.to monthly
8. Give a Dev talk
9. Start working out
10. Get/build a Solar Powered Apartment
Securing IoT devices connections with blockchain: does it make sense?
Tags: blockchain, security, discuss, opensource
Published: 2019-02-01 12:39:11

---
title: Securing IoT devices connections with blockchain: does it make sense?
published: true
description: Let's discuss the case study where connections between IoT devices i.e., CCTV cameras and the server can be secured by digital certificates with public keys stored on the blockchain.
tags: blockchain, security, discuss, opensource
---

**Case Study:**

Company X deploys a fleet of connected IoT devices with capabilities of Hardware Root of Trust, in which the private keys are integrated into the devices.

1. The System Administrator of Company X has an account registered on the blockchain.

2. He will need to install a special firmware (or just modify an existing version of it) on the IoT device (i.e.: a CCTV camera). It should generate a pair of keys in the device.

3. At this point, the SysAdmin obtains device public-key and stores it on the blockchain using his account. The device is able to send the public-key by itself, but it needs access to the account. As an alternative, this could be done via a service where blockchain account keys are pre-installed.

4. Now the SysAdmin is able to set up a secure encrypted connection with all the CCTV cameras that he needs. In case he needs to revoke camera's public keys, he can do so by using the private key of his blockchain account.

**The blockchain account**

It has a pair of the public/private keys which the user generates with one of the project libraries on his device. The account enables to store public key on the blockchain as well as revoking them. Using the pair of keys of just one account, you may store on the blockchain as many public keys as you need. In blockchain technology, there are several ways to secure access to your account, for example, multi-signature.

**Why should devices trust each other without a CA signature?**

In this scenario, the Admin will send a request to the blockchain for storing the public keys of each of the two devices and will install private keys on each of them respectively. This way the admin is responsible for providing the correct public key connecting two devices/applications. Nobody can store a public key which was previously added to the blockchain.

What do you think about the case described? Are there any weaknesses which hackers can spot?

And what's about a service that can help to provide such certificates for admins and developers who are not willing to interact with the blockchain directly? Would you use such a service, if it were available?

Here you can have a look at [a protocol](https://github.com/Remmeauth/remme-core/tree/dev) able to perform the services described, other than a Public Key Infrastructure.