teleren/devto huggingface dataset:
Finding knowledge is not hard. Putting it all together is.
Tags: javascript, react, frontend, learning
Published: 2018-05-11 06:44:14

---
title: Finding knowledge is not hard. Putting it all together is.
published: true
description: Lots of great resources on React out there, the hard part is not finding them but putting them all together ...
tags: javascript, react, frontend, learning
cover_image: https://thepracticaldev.s3.amazonaws.com/i/6rjputr0cvdb4n2xr3ao.jpg
canonical_url: http://dev.topheman.com/project-to-help-getting-into-making-react-apps/
---
## The reason why I made topheman/npm-registry-browser

In software development, a lot of great quality resources are available, often for free. I’ve been getting feedbacks from developers – at work, online, at meetups – who shared that **the hard part is not finding the knowledge** but **picking one library over an other or putting them all together**.

Tutorials explaining a specific problem are all over there, what’s missing is projects examples / courses with a **wider point of view**.

This is what I decided to do in my latest project: [topheman/npm-registry-browser](https://github.com/topheman/npm-registry-browser). I respect some constraints that you would get, developing a real-world application, such as:

* external API calls
* using external libraries (UI kits, router, http clients …)
* project setup for development with teams
* code quality (linter, code formatting)
* tests (unit / end to end)
* automation / dev pipeline

The project itself is a Single Page Application that lets you search for packages in the npm registry and show details for each one of them such as the readme, the versions, the stats … In fact, **this project is just an excuse to expose how to put together all those technologies** I mentioned above.

The source code is available on [github](https://github.com/topheman/npm-registry-browser). You can test a [demo online](https://topheman.github.io/npm-registry-browser). I will be adding more features in the next weeks.

[TRY IT](https://topheman.github.io/npm-registry-browser)

**PS:** This project is based on [create-react-app](https://github.com/facebook/create-react-app) and remains **unejected**. It was [a constraint](https://github.com/topheman/npm-registry-browser#why-not-eject-) I imposed myself from the start. I never used CRA before (I have my own [webpack starter-kit](https://github.com/topheman/webpack-babel-starter)), so I wanted to test it to be able to tell what’s possible to do with it and what is not.

**PPS:** I chose not to use Redux, at least, not in that first version because … [You might not need Redux](https://github.com/topheman/npm-registry-browser#why-not-use-redux-) (explanation) …

📺[Watch video of the talk (fr)](http://dev.topheman.com/pourquoi-realiser-topheman-npm-registry-browser-video-talk/)

This post was originally posted on [my blog](http://dev.topheman.com/).
Seven must join DevOps groups on LinkedIn
Tags: devops, microservices, cicd, cloudcomputing
Published: 2018-05-11 05:44:32

---
title: Seven must join DevOps groups on LinkedIn
published: true
description: Seven must join DevOps groups on LinkedIn to enjoy the real discussions, learn new DevOps concepts, tools, and much more.
tags: DevOps, Microservices, CI/CD, Cloud Computing
---

1. [Cloud Native Application Delivery and DevOps](http://bit.ly/devopsgroup) 
About this group: Our mission is to provide a resource for people who want to learn how to reduce the headaches and effort around deploying and managing software in the cloud. Meet and share ideas with people who love creating software but hate the hassles of managing versions, integration testing, and vendor lock-in. Whether you are a software engineer who builds software or a manager looking for ways to improve your software development processes this is the place for you. The members of our group believe that cloud computing doesn't mean replicating the same constraints that existed with on-premise computing. Creating code for the cloud should be fun, not bogged down with process debugging.

2. [DevOps (AWS, Azure, Cloud, Docker, Microservices, Serverless, Blockchain ) Discussions](http://bit.ly/devopsgroup2) 
About this group: Discussion on AWS, Azure, DevOps, Microservices, Containers (Docker), Serverless Computing, Clustering and Distributed Systems.

3. [Docker Professionals Network ☁ Container Infrastructure Architects Developers DevOps Engineers Cloud](http://bit.ly/devopsgroup3)
About this group: Engineer Developer Architect Expert Linux Kernel LXC LXD Cgroups Kubernetes Namespace Isolation Containerization Containers Image AWS EC2 Registry Swarm Machine Engine Parallels OpenVZ CoreOS RancherOS PaaS Vagrant OpenStack SaltStack Capistrano Ansible Puppet Labs Chef Virtualization San Francisco


4. [DevOps](http://bit.ly/devopsgroup4)
About this group: This is the Linkedin group for the DevOps.com community.


5. [DevOps Europe](http://bit.ly/devopsgroup5)
About this group: UNICOM ( www.unicom.co.uk ) - organiser of the DevOps Summit and DevOps Showcase conferences, created the DevOps Europe Group for people working and interacting between development and operational activities within an enterprise to meet, share ideas, discuss technical problems and make valuable business contacts.


6. [Cloud Development - Cloud Computing, Microsoft Azure, Big Data, Hadoop, NoSQL, DevOps, SQL](http://bit.ly/devopsgroup6) 
About this group: Cloud Development - Cloud Computing, Microsoft Azure, Big Data, Hadoop, NoSQL, DevOps, SQL


7. [DevOps Engineers Worldwide](http://bit.ly/devopsgroup7)
About this group: This group is dedicated to DevOps Engineers and Professional worldwide.


If you know any other groups worth joining, share in the comments.
Google Duplex: Has AI Gone Too Far?
Tags: discuss
Published: 2018-05-10 21:26:12

---
title: Google Duplex: Has AI Gone Too Far?
published: true
description: 
tags: discuss
---

https://ai.googleblog.com/2018/05/duplex-ai-system-for-natural-conversation.html

{% youtube USXoINPEhoA %}
Startup Clix: Pre-Authentication & Webhooks with Pusher
Tags: pushercontest, javascript
Published: 2018-05-10 21:06:05

---
title: Startup Clix: Pre-Authentication & Webhooks with Pusher
published: true
description: 
tags: pushercontest, javascript
series: [pusher contest]
---

Today I realized that this activity task issue probably won't be fixed soon and I need some extra storage to get around it, but I also made a few improvements.

## Pre-Authentication

Until now my channel join process relied on two requests, but Pusher allows for [custom authorisers](https://support.pusher.com/hc/en-us/articles/235643487), which helped me to get it down to one request.

My idea was, a player comes on the site and requests a game channel ID. Then they subscribe to it and will get their updates through it.

The subscribe method will call an authoriser, which in turn will call my back-end to authorise the player.

But with a custom authoriser I was able to get the auth credentials right with the request for the channel ID. A small win and one possible race condition eliminated (still one left, hurr)

## Step Function Activities could be better

There are two ways to interact with a state-machine via Lambda.

One is to simply let the state-machine call a Lambda and push its input into it, then wait till the Lambda returns the data.

Two is to create an activity. This has an ARN that can be used to poll a state-machine task via a API-Gateway Lambda, do some stuff with it and give it back to the state-machine so it can go on. Problem is, there can be multiple parallel executions of a state-machine and you can't filter when polling a task. 

My idea was, every game will be one state-machine execution, but since I can't get the right tasks there doesn't seem to be a simple way to push data into the right state-machine execution.

## Webhooks

I added a Lambda that gets called via Pushers Webhook functionality. Every time a Player joins a game channel, the Webhook is called. The Lambda that is run in response to that will check if that joined channel is full and send a `game:start` event to all players in the channel.

## Next

While today was mostly filled with thinking about how Step Function can be bent to my will, the next step is to bend myself to the will of AWS, hurr...

Anyway, kicking off a state-machine execution when a channel is full.

Only allow players to channels that aren't full and have no running state-machines.

Adding a DynamoDB to store game data that is sent every round via a HTTP request to the back-end.

Define a state-machine that gathers game data from DynamoDB every round, checks who has lost and who one etc.
[Laravel tips] How to temporarily change a laravel environment variable without updating the .env file
Tags: laravel, tips
Published: 2018-05-10 20:38:00

---
title: [Laravel tips] How to temporarily change a laravel environment variable without updating the .env file

published: true
description: 
tags: laravel, tips
---


Imagine the following scenario: you are working on a laravel application that dispatches some jobs to a queue. You notice in your log file that a specific job is throwing an exception, but you can’t debug it directly (with `dd()` for instance), since the job is consumed by a worker elsewhere.

![](https://i2.wp.com/youghourta.com/wp-content/uploads/2018/05/laravel-tips.png?resize=660%2C334)

One way to debug this issue would be to change the `QUEUE_DRIVER` environment variable in your `.env` file to `sync`, debug, and then revert back the change after you finish.

Or imagine that you have a test database and you need to run the migrations on it first, and you’d need to update the `.env` file to use the test database first, run the migrations and then revert back the change.

As you can see, in both cases, all what we need to do is to update the environment variable temporarily. And usually, it takes some time to update the `.env` file (you might even need to clear the configuration or restart some workers).

Luckily, it is possible to pass an environment variable to linux commands, and these variables will only be used for the current execution.

In the previous example, all what we have to do is to execute the command as follows:

`QUEUE_DRIVER=sync php artisan my-artisan-command-here`

You can test it yourself with tinker.

![](https://i2.wp.com/youghourta.com/wp-content/uploads/2018/05/env-variable.png?resize=631%2C266)

You can even pass multiple environment variables like this:

`QUEUE_DRIVER=sync DB_DATABASE=testing php artisan my-artisan-command-here`

As you can see, this is not a laravel specific trick, and you can use it whenever you find yourself in a situation where you need to change an environment variable temporarily.

I hope you’ll find this useful.
How to generate code for http requests
Tags: http, javascript, curl, githunt
Published: 2018-05-10 18:52:22

---
title: How to generate code for http requests
published: true
description: 
tags: #http, #javascript, #curl, #githunt,
---

check [this](https://pranayrauthu.github.io/fetcher/) webapp to generate code for http requests.

{% github pranayrauthu/fetcher %}


UPDATE: 22-06-2019

following features are added in recent updates

- request sharing (with permalink)
- response preview
DEV Monthly Report — May 2018
Tags: meta
Published: 2018-05-10 18:14:01

---
title: DEV Monthly Report — May 2018
published: true
description: Our monthly report to the dev.to community ❤️
tags: meta
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fn26afgw5i3hjbmnhawv.png
---

Hey everyone, hope your May is off to a good start.  Here's a brief report from last month:

**Community Growth**: The DEV community has now grown to over 70,000 registered members.  In April, we served over 1.44 million sessions, and the platform saw record levels of engagement in the form of comments, articles, and positive reactions ❤️🦄.  I've loved keeping an eye on the [Welcome Thread](https://dev.to/thepracticaldev/welcome-thread---v12-1p1d) where new members from all across the world introduce themselves.

**Product Improvements**: If you haven't done so already, consider following the [#changelog](/t/changelog) tag to keep up-to-date on new features.  In addition to the new comment preview, we adjusted the layout of the article page to make a bit more room for suggested reads and author information.  I've definitely been finding myself spending more time looking at member profiles recently 👀.

**Pusher Contest**: While the contest [officially launched](https://dev.to/devteam/first-ever-dev-contest-build-a-realtime-app-with-pusher-4nhp) in May, there was a lot of behind-the-scenes coordinating and preparation in April.  We're really excited about the response so far, and we look forward to continuing to watch member submissions roll in over at [#pushercontest](/t/pushercontest).

As always, please feel free to ask away in the comment section below.  Thanks for being a part of the community :)

--- 

PS — we're going to change the naming convention on these "monthly report" posts ([past versions](https://dev.to/search?q=monthly%20report)).  We felt it was a little confusing to title the posts with the previous month's date, so we're officially skipping the "April" report and will now name them based on the month we're currently in going forward.
MySQL general query logs
Tags: mysql, querylogs
Published: 2018-05-10 18:07:30

---
title: MySQL general query logs
published: true
description: MySQL general query logs is very useful in Application profiling & debugging.
tags: #mysql #querylogs
---


This was first published [here].
[here]: https://thecuriousfrequency.wordpress.com/2015/11/25/mysql-general-query-logs/


MySQL can log every activity in General query logs. This can be helpful in application profiling when you want to see which queries are being executed or when a commit or rollback is executed. It can also be helpful in applications which use ORM as logs shows raw SQL.


You can enable MySQL general query logs by running below query in MySQL console :

```sql
SET GLOBAL general_log = 'ON';
```
Note : You don't need to restart MySQL server. 

you can check log file location using below command.
```sql
show variables like 'general_log_file';
```

It will show you a location like :-  /var/lib/mysql/filename.log

Now you can analyse your logs to find some useful information. If size of logs generated is heavy you can consider analysing it using a tool like pt-query-digest (https://www.percona.com/doc/percona-toolkit/LATEST/pt-query-digest.html) which  is provided by Percona.

You can disable it using, 
```sql
SET GLOBAL general_log = 'OFF';
```
For more information & options you can read the official documentation here.
https://dev.mysql.com/doc/refman/5.6/en/query-log.html
How do you test your configuration files in production?
Tags: production, test, devops, discuss
Published: 2018-05-10 15:59:39

---
title: How do you test your configuration files in production?
published: true
description: 
tags: #production #test #devops #discuss
---
How do you make sure that the right values have been placed in the right configuration files?
How do you test it  (safely)? Just staging environment?
How do you automate the process? do you have any configuration verification utilities?
Do you test them individually? or just as part of your rollout tests? 

Can you elaborate? 

Thanks for sharing ;)
Switching from Laravel to Jigsaw
Tags: jigsaw, laravel, staticsitegenerato
Published: 2018-05-15 00:47:53

---
title: Switching from Laravel to Jigsaw
published: true
tags: jigsaw,laravel,static-site-generato
canonical_url: 
---

Sometime ago I gave myself the job of redesigning my personal website. The first version was made using the Laravel Framework.

For this second version I started thinking if Laravel really was needed for a simple portfolio site like mine. After a few days of analyzing the code I wrote for the first version of the site, I discovered that I simply used Laravel bacause I love the Blade Templating Engine that comes with it. After coming to this realization I focused on finding a light, realiable and good tool I could use to simply set up a beautiful, eye-catching personal website where I could just create a markdown file and share my thoughts with everyone. After a few days of looking at a lot of great stuff online, I found the perfect tool for my needs, [Jigsaw](http://jigsaw.tighten.co/).

### What is Jigsaw

At it’s core, [Jigsaw](http://jigsaw.tighten.co/) is a framework for building static websites. It helps developers rapidly build static sites using the same modern tooling that you would use when building dynamic web applications.

### What sets Jigsaw apart from common .html files

Using [Jigsaw](http://jigsaw.tighten.co/) instead of creating some .html files and serving them online brings a lot of great features to the table. You have access to a lot of great features from the Laravel Framework but in a light and minimal form.

#### Some of the features [Jigsaw](http://jigsaw.tighten.co/) offers are:

- Blade Templates
- Markdown pages
- .blade.md files (Yes, Blade and Markdown mix)
- Global Configuration File (It’s very handy)
- Lots of helper methods
- Collections
- Sorting
- Pagination
- Variables and helper methods
- Laravel Elixir support out of the box

### The last design

Here is what the last design of the site looked like, I hope you like the new design I have made. Go take a look at the current design [here](https://wilburpowery.co).

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

### Conclusion

[Jigsaw](http://jigsaw.tighten.co/) is an awesome framework for creating static websites where you just need to display static content but you still want to use some of the features you love about Laravel, like Blade templates. Getting started is very easy, their [documentation](http://jigsaw.tighten.co/docs/installation/) is great, and it’s still part of the Laravel community you love and enjoy.
Naming Nested For Loops in Rust
Tags: rust
Published: 2018-05-10 13:27:06

---
title: Naming Nested For Loops in Rust
published: true
description: 
tags: rust
---

I've been aware of the ability to name for loops in rust for a while, but a recent project made me consider how that can make code more readable. It almost can take the place of a separate comment. My project took a string of variable length and looked for sets of keywords, trying to return the most relevant match.  Some keywords and positions would carry more weight in determining relevancy.

```
'clauses: for clause in text.split(";") {
    'phrases: for phrase in clause.split(",") {
        'words: for word in phrase.split_whitespace() {
            'mainkeywords: for mainkey in MAIN_KEYS.iter() {
                match word.find(mainkey) {
                    Some(_) => { dostuff(word);
                                 break 'phrases 
                               },
                    _ => 'secondarykeys: for key in SECONDARY_KEYS.iter() {
                             match key.find(word) {
                                                   Some(_) => do_other_stuff(word);
                                                   break 'words 
                                                  }
                 }
              }
           }
       }
    }
```

Naming the loops can have the same effect as comments while providing some useful function. I hadn't seen naming loops as a code organization/readability tool mentioned before and though I'd share. If anyone has comments on this approach in general or the code above specifically I'd love to hear them.
Weekly Command: managing processes with htop
Tags: weeklycommand, xnix, monades
Published: 2018-05-17 19:07:35

---
title: Weekly Command: managing processes with htop
published: true
tags: weekly-command,xnix, monades
canonical_url: https://monades.roperzh.com/weekly-command-managing-processes-with-htop/
---

![overview](https://user-images.githubusercontent.com/4419992/40049134-474ba27e-580a-11e8-9068-bc5951933f9e.jpg)

## The basics

```
htop [-dChustv]
```

`htop` is an interactive command-line process manager that allows you to visualize, sort and manage processes running in your system.

As with many other great command-line utilities, `htop` is built with `ncurses`, so the interface may look familiar to you.

You can run the command without any flags and start interacting with your running processes immediately.

_fun fact: the community has a [list of TV shows and films](https://hisham.hm/htop/index.php?page=sightings) where `htop` has appeared._

## Examples

`htop` is very well designed, and your great ally is the help bar at the bottom, which makes the program very intuitive to use, nonetheless here are some examples.

### Sending different signals

While the bottom-bar menu presents an option to kill the selected process with `F9`, you can send any signal to them by pressing the `k` key and selecting the desired signal.

### Tagging multiple processes

Multiple processes can be marked and then signaled at the same time by using the tagging functionality. You can tag a process with the spacebar `␣` or a process with all its children with `c`.

To untag all processes at once you can use `U`.

### Searching and filtering

You can search and filter processes incrementally by name by using `F3` or `/` to search and `F4` or `\` to filter.

### Leveraging arguments

Besides all the goodness of the user interface, you can also manage some of the features of `htop` when launching it via custom flags, here are some of my favorites:

- `--no-color` starts the program in monochrome mode, personally, I find it very pleasant to use.
- `--pid=PID1,PID2...` only shows the given comma-separated list of PIDs.
- `--tree` shows the processes in the tree view.

## Configuring

![config](https://user-images.githubusercontent.com/4419992/40049133-471ec18c-580a-11e8-94ba-04ec5cf3370a.jpg)

`htop` provides a nice interface to configure the UI: from the meters at the top to the number of columns displayed for every process, almost everything can be changed. This interface lives in the setup menu, which can be opened with `F2`, once there you will be presented with several menus to configure.

Your configurations are stored in `~/.config/htop/htoprc` by default, and this file is automatically managed by `htop` so you shouldn’t have to manually change it. The path to the config file can be set with the `$HTOPRC` environment variable, allowing you to have different config files for different scenarios.
Google Duplex - The Conversation about Ethics?
Tags: ai, google
Published: 2018-05-10 10:10:30

---
title: Google Duplex - The Conversation about Ethics?
published: true
description: Google Assistant makes a call to book an appointment on your behalf. Whoever is at the other end very likely gets no hint whatsoever they're talking to a robot.
tags: ai, google
---

In case no idea what Duplex is:

{% youtube wqhxVwXI6q8 %}

I for one, don't care, talking to a robot, whether I know or not, as long as it gets the job done, can convey the thoughts in a manner that is complete.

Heck, we "talk" to Siri, Google Assistant and Alexa everyday.

Google's Duplex is more like the other way round, where the Assistant rather initiates the conversation, and does it so well, it's human-like.

Is it ethically wrong? What are the moral implications?

{% twitter 994028523563241472 %}

Should such robot's 'disclaim' themselves at the very beginning of such calls?

Are you likely to pick a call by a bot if you know it's a bot, and the bot tells you, it's a bot?

And just a fun scenario:

{% twitter 994077948029362176 %}