teleren/devto huggingface dataset:
What is Strict Mode in JavaScript?
Tags: javascript, react, beginners, tutorial
Published: 2019-11-04 18:00:16

Learn how Strict mode in JavaScript works. The Strict has different semantics that the non-strict JavaScript code.

It provides the safety net to the developers and help them in avoiding mistakes in the programs.

Learn with hands-on examples in this video.


Code samples available at https://gist.github.com/SuperBonsaii/30551ea9f7d4b7bef48f2e65e4a02325#file-strict-mode-in-javascript-md

**********Watch all JavaScript Tutorials**********

http://bit.ly/javascript-youtube

***************************************************

Harit on Twitter: https://twitter.com/harittweets

Subscribe for more videos on JavaScript with Visualization: https://www.youtube.com/channel/UC0yZBnRsD9JRqLXBkfGym0Q?sub_confirmation=1
Follow bonsaiilabs on Twitter: https://twitter.com/bonsaiilabs
Follow bonsaiilabs on Facebook: https://www.facebook.com/thebonsaiilabs
Visit bonsaiilabs at https://bonsaiilabs.com
Podcast: .NET With Scott Allen
Tags: podcast, dotnet, programming
Published: 2019-11-04 17:56:29

---
title: Podcast: .NET With Scott Allen
published: true
description: Pluralsight is launching it's brand new podcast today, All Hands on Tech. For the first episode we're going to be talking with Scott Allen
tags: podcast, dotnet, programming 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vu1putz6qvjy62wif48c.jpeg
---

Pluralsight is launching its brand new podcast today, [All Hands on Tech](http://bit.ly/AllHandsOnTech000).

{% podcast https://dev.to/allhandsontech/000-a-conversation-with-scott-allen %}

For our first episode, I got the opportunity to speak with the one and only [Scott Allen](http://bit.ly/OdeToCodeScott)!

If you’re a .NET Developer you likely already know who Scott is. He’s a developer of 25+ years, a [Pluralsight Author](http://bit.ly/ScottAllenPS), the CTO of [Medisolv, inc](https://medisolv.com/) and co-host of the podcast [Herding Code](http://bit.ly/HerdingCode). He’s also a Microsoft Regional Director, and MVP. And he’s easily one of the nicest guys in tech.

###DURING OUR CHAT WE TALKED ABOUT:

- His background and how he got started
- .NET Core 3 and the cool new releases
- Blazor!!
- A cool new Azure feature you probably haven't heard of

So join us and take a listen to our first podcast! 

###WHERE YOU CAN FIND IT:

- [Web](http://bit.ly/AllHandsOnTech000)
- [Spotify](http://bit.ly/AHOT000)
- [Google Play](http://bit.ly/320xGS3)
- [Stitcher](http://bit.ly/2NnFpnV)


What do you think of this podcast? Ideas? [Let me know!](http://bit.ly/JeremyCMorgan)
Integrating PubSub+ Event Broker with Boomi Using JMS
Tags: solace, boomi, jms
Published: 2019-12-03 17:29:13

---
title: Integrating PubSub+ Event Broker with Boomi Using JMS
published: true
date: 2019-11-04 17:51:07 UTC
tags: solace,boomi,jms
canonical_url: https://solace.com/blog/pubsub-event-broker-boomi-jms/
---

 ![](https://solace.com/wp-content/uploads/2019/11/blog-featured-image-boomi-icon.jpg) 

Solace offers a great way to move data around, but when it comes to working with that data, you need a product like Boomi’s iPaaS to parse, transform, enrich, and route the data based on content, etc. With Solace, you can have Boomi Atoms communicate with each other across a data center, between different clouds, or between applications across the globe.  I’ve just published [a guide that walks you through the basics of doing so](https://docs.solace.com/Developer-Tools/Integration-Guides/Boomi-PubSub-Integration.htm).

[![Solace PubSub+ Event Broker Integration with Boomi using JMS](https://solace.com/wp-content/uploads/2019/11/pubsub-integration-boomi-using-jms.png)](https://docs.solace.com/Developer-Tools/Integration-Guides/Boomi-PubSub-Integration.htm)In it I show a bit of the Solace PubSub+ Cloud user interface and a bit of the Boomi AtomSphere user interface. Later in the guide we use a bit of Postman to initiate a REST POST.  This is not a tutorial on any of the three products — its purpose is to give you a few examples and get you up and running as quickly as possible so you can see how they work together, and from there you can explore.

Here is a high-level overview of what you will perform:

- How to get a Solace Cloud PubSub+ instance up and running
- How to get access to a Boomi instance (cloud or on prem)
- How to get them talking to one another (using JMS)

Then there are three exercises that show you how to have:

1. Boomi listen to a Solace Topic
2. Boomi write to a Solace Queue
3. Boomi listen on a Solace Topic, parse the received data, and use that to set the publication destination back to Solace (content-based routing)

Solace and Boomi are perfect partners for distributing data and services in new hybrid and multi-cloud deployment patterns. [This guide](https://docs.solace.com/Developer-Tools/Integration-Guides/Boomi-PubSub-Integration.htm) shows you how to get started. I hope you’ll check it out, and if you have any questions, share them with the [Solace Community](https://solace.community).

The post [Integrating PubSub+ Event Broker with Boomi Using JMS](https://solace.com/blog/pubsub-event-broker-boomi-jms/) appeared first on [Solace](https://solace.com).
What Do You Think About Sanctions Affecting the Software Industry?
Tags: discuss
Published: 2019-11-04 17:13:40

Perhaps you know, GitLab discusses not to hire software developers living in China and Russia.
They opened an issue to discuss this topic.

> In e-group on Monday October 15, 2019 we took the decision to enable a "job family country-of-residence block" for team members who have access to customer data. This is at the expressed concern of several enterprise customers, and also what is becoming a common practice in our industry in the current geopolitical climate.

I really hate racism. Nobody can choose their nationality. In this community, there are many Chinese and Russian developers.

They always evolving the software world like us. They currently don't have any Chinese or Russian developers. But as a Turkish developer, I'm really afraid of these kinds of sanctions.

I didn't choose my government and their ideas, I didn't want to born here.

These have happened and nobody asked me. 

I just thought, someone, is judging me today. I'm being judged because of the things that I didn't choose.

This isn't good. This isn't us. Even the discussion of such things is terrible.
Study Group - Week 3
Tags: makers, ruby
Published: 2019-11-04 17:41:56

Another week is over which means another study group and once again there were more people there so it seems our group is slowly growing, maybe by January, we'll have the whole cohort attending. Since this is the end of week 3 we were finishing up the *"mastery quizzes"* although I and some of the rest of the group were already finished them, this was really convenient timing because at the start of week 4 was the TDD(Test, Driven, Development) which is to be done in pairs.

I got my pairing done earlier in the week which left me to my own devices and gave me a chance to be nosy a see what other people were doing. I think chapter 9 was the problem this week I found myself struggling with it earlier in the week but everyone was able to resolve their problems by asking other members of the group, so I continued with a side project that I and 2 other members of my cohort were working on. We decided to make a poker simulator that's to be played in the command line so far it's going well, as they say, *"2 heads are better than 1"*, so you can imagine how well our 3 heads are doing. This side project is way more fun than the assigned pairing because it's far more challenging. and we’re able to just throw ideas around and discuss what would work best then we try it if there's a problem we're able to check the error message and troubleshoot the problems one person at a time until we eventually get it. overall this study group has go great so far and it building comradery amongst us already.

Before everyone left I suggested we all go for a drink sometime this week to lift spirits and celebrate making it through the pre-course. Making it through the precourse may not be a groundbreaking achievement but I think it's a good idea to celebrate the little things, That said it's probably best we don't go too mad or we might have a study group next week!
Creating a Postgres database + user
Tags: postgres, sql
Published: 2019-11-04 17:40:37

---
title: Creating a Postgres database + user
published: true
description: Something you'll need to do frequently, but might need to look up every time..
tags: postgres, postgresql, sql
---

Let's create a new database + a user to access it.

1. `su - postgres` to get a shell as the postgres user
2. `psql` to get a postgres shell
3. `create database db_name;` to create the database
4. `create user user_name with encrypted password 'user_password';` to create the user
5. `grant all privileges on database db_name to user_name;` to grant the user all privileges on the database.

That's it really.

---

As a brief aside, I like to write my SQL in all lowercase.  I find it really annoying to use all caps for statements and all lowercase for variables, which seems to be a syntactic standard with no real benefit?  Anyone else do this / have a comment on this?

---

Follow me on dev.to for more code blurbs, or on [Twitter @connorbode](https://twitter.com/connorbode)
How to replace component lifecycle with useEffect hook in React?
Tags: react, webdev
Published: 2019-11-04 17:35:07

Originally posted on [my blog](https://www.ibrahima-ndaw.com/blog/replace-component-lifecycle-with-useEffect/) <hr>

Before React 16.8, we were forced to use the class-based component to have access in component lifecycle. And now with Hooks, we are now able to use functional component for state management, data fetching etc. We can now replace component lifecycle like `componentDidMount`, `componentDidUpdate` and `componentWillUnmount` with `useEffect` in our React component.

# 1. componentDidMount
The `componentDidMount()` method runs after the component output has been rendered to the DOM. This is a good place to cause side-effects. 
```javascript
// With ccomponentDidMount()
componentDidMount() {
    console.log('Hello World');
}

// with useEffect()
useEffect(() => {
    console.log('Hello World');
}, [])
```
If we don't pass an empty array to `useEffect`, it will run on every change. Therefore, we must give as second argument an empty array to mimic the componentDidMount behavior. It tells to React that your effect doesn’t depend on any values from props or state, so it never needs to re-run, `useEffect` will run only once after the component is created.
# 2. componentDidUpdate
The `componentDidUpdate()` method is invoked immediately after updating occurs.
```javascript
// With ccomponentDidUpdate()
componentDidUpdate(prevProps) {
    console.log(`Hello World ${prevProps}`);
}

// with useEffect()
useEffect(() => {
    console.log('Hello World');
}, [prevProps])
```
When we pass a value(`prevProps`) to the array, it tells to `useEffect` to run only if the value change. 

# 3. componentWillUnmount
The `componentWillUnmount()` method is called immediately before a component is unmounted and destroyed. It is a good place to do some cleanup works.

```javascript
// With ccomponentDidUnmount()
componentWillUnmount() {
    console.log('Hello World');
}

// with useEffect()
useEffect(() => {
    console.log('Hello World');
    return () => {
        console.log('Do some cleanup');
    }
}, [])
```
By returning an anonymous function with `useEffect`, it will run before the component unmounting. And the empty array passed as second argument tells to `useEffect` to run when the component will be mounted or unmounted.

| [TWITTER](https://twitter.com/ibrahima92_) | [BLOG](https://www.ibrahima-ndaw.com/) | [NEWSLETTER](https://ibrahima-ndaw.us5.list-manage.com/subscribe?u=8dedf5d07c7326802dd81a866&id=5d7bcd5b75) | [GITHUB](https://github.com/ibrahima92) | [LINKEDIN](https://www.linkedin.com/in/ibrahima-ndaw/) | [CODEPEN](https://codepen.io/ibrahima92) | [DEV](https://dev.to/ibrahima92) |
| -------------- | ------------------------------------------ | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------ | ---------------------------------------- | -------------------------------- |
Testing Web Applications Running on Localhost With an iPhone
Tags: webdev, tutorial, ios, testing
Published: 2019-11-04 17:01:43

---
title: Testing Web Applications Running on Localhost With an iPhone
published: true
description: Short how-to guide on setting up your iPhone to test your web app
tags: #webdev, #tutorial, #ios, #testing
---

I recently switched from an Android phone to an iPhone and discovered that it is so much easier to test my web application running on localhost on my MacBook with my new phone.

Here are the steps to make it work.

On the iPhone, go to *Settings → Safari → Advanced* and activate the switch “web inspector”:

![Switching on “web inspector”](https://thepracticaldev.s3.amazonaws.com/i/hb6nu6b1aop6dr5wepw4.jpeg)

Connect the phone to your MacBook using a lightning-to-USB cable.

On the MacBook, open up Safari and make sure you have the „Develop menu“ activated (most web developers will have done this already):

* Pull down the “Safari” menu and choose “Preferences”
* Click on the “Advanced” tab
* Check the box next to “Show Develop menu in menu bar”

Then go to *Develop → NAME_OF_YOUR_IPHONE* and select “Connect via Network”:

![Selecting the iPhone in Safari](https://thepracticaldev.s3.amazonaws.com/i/bxzwhbg3g9f3teg73ljd.png)

Open up a terminal and run the command “ifconfig” to see the list of current network interfaces and take note of the IP address of the last entry in the list:

![Running ifconfig to find IP address](https://thepracticaldev.s3.amazonaws.com/i/g7nj1y872xnrkr2hfyvy.png)

On your phone, in Safari, use the IP address to access your locally running website. For example, if you use [create-react-app](https://github.com/facebook/create-react-app), instead of going to http://localhost:3000, with the IP I got here, the address to use is http://169.254.145.56:3000 (don’t forget the *http://* prefix):

![Local host webapp on your phone](https://thepracticaldev.s3.amazonaws.com/i/db31a3ieqshkk3wob2ey.jpeg)

You can now inspect the website displayed on your iPhone with your MacBook’s Safari by selecting it in the *Develop* menu:

![Inspecting the website](https://thepracticaldev.s3.amazonaws.com/i/3mtijakbam9xsvpuu1iv.png)

This will open up a Web Inspector window that allows you to look at the DOM, styles and console log from your iPhone:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/30iszkgyl6qzbqslrbpl.png)

<hr>

This article originally appeared on the [eBay Tech Berlin](https://ebaytech.berlin/) blog.<br>**Join our team – [we are hiring](https://ebayinc.to/germany)!**
Godot You Want To Make A Videogame
Tags: videogames, godot
Published: 2019-11-04 16:47:00

{% youtube 4o63V0AdrHk %}

What is Godot?  It's an open source game engine for making high quality 2D or 3D videogames!  At this Frederick Linux User Group (KeyLUG) presentation, I explained how Godot works, compared it with other popular engines, and showed off some of its features.

The recording from the talk is available on YouTube.  [Check it out!](https://www.youtube.com/watch?v=4o63V0AdrHk)

In this presentation, we looked into:

* Other popular open source game engines like [Pygame](https://www.pygame.org/news), [LÖVE](https://love2d.org/), and [Phaser](https://phaser.io/).
* The proprietary options of [Unity](https://unity.com/), [GameMaker Studio 2](https://www.yoyogames.com/gamemaker), [Unreal Engine](https://www.unrealengine.com/en-US/), and [CRYENGINE](https://www.cryengine.com/).
* why Godot is a great choice.
* how to use the editor.
* sample projects that showcase different types of games.

Questions?  Feel free to mention me on Twitter at [@mblayman](https://twitter.com/mblayman) so I can try to respond to your question.
How to POST multipart/form-data in GO using Mux
Tags: go, upload, mux, vasubabu
Published: 2019-11-04 16:42:21

[Mux](https://github.com/gorilla/mux) is a powerful HTTP router that matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions.

Enough talking ....

Please create a new file called `main.go` and paste the below contents

```
package main

import (
	"fmt"
	"github.com/gorilla/mux"
	"io"
	"log"
	"net/http"
	"os"
)

func UploadFile(w http.ResponseWriter, r *http.Request) {
	file, handler, err := r.FormFile("file")
	fileName := r.FormValue("file_name")
	if err != nil {
		panic(err)
	}
	defer file.Close()

	f, err := os.OpenFile(handler.Filename, os.O_WRONLY|os.O_CREATE, 0666)
	if err != nil {
		panic(err)
	}
	defer f.Close()
	_, _ = io.WriteString(w, "File "+fileName+" Uploaded successfully")
	_, _ = io.Copy(f, file)
}

func homeLink(w http.ResponseWriter, r *http.Request) {
	_, _ = fmt.Fprintf(w, "Welcome home!")
}

func main() {
	router := mux.NewRouter().StrictSlash(true)
	router.HandleFunc("/", homeLink)
	router.HandleFunc("/file", UploadFile).Methods("POST")
	log.Fatal(http.ListenAndServe(":8081", router))
}

```

Build it - `go build`

Run it - `go run main.go`

Test it - Using Postman/Curl

### Postman:
![alt text](https://i.ibb.co/L51TdHG/Screenshot-2019-11-04-at-9-57-27-PM.png)

### CURL:
```
curl -X POST \
  http://localhost:8081/file \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 4251' \
  -H 'Content-Type: multipart/form-data; boundary=--------------------------489143350034706567613009' \
  -H 'Host: localhost:8081' \
  -H 'Postman-Token: fea94e80-8294-4f0b-87bf-09b706eddac8,1bbb735b-f88d-4194-a1b5-f8cd90189545' \
  -H 'User-Agent: PostmanRuntime/7.17.1' \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F file=@/Users/vasubabujinagam/Documents/protobuf-3.9.2/CONTRIBUTORS.txt \
  -F file_name=file1
```
Day 2 of⚡️ #30DaysOfWebPerf ⚡️: Why performance matters
Tags: webperf, webdev, climate, privilege
Published: 2019-11-04 15:53:58


{% twitter 1191381707699699712 %}
{% twitter 1191381708928692226 %}
{% twitter 1191381710002360321 %}
{% twitter 1191381710719586305 %}
{% twitter 1191381711466221569 %}
Build CSS3 Flexbox Holy Grail Layout in Angular 8/9
Tags: angular, buildcss3, holygraillayout, angular89
Published: 2020-02-07 09:38:18

---
title: Build CSS3 Flexbox Holy Grail Layout in Angular 8/9
published: true
date: 2019-11-04 15:48:47 UTC
tags: Angular ,Build CSS3,Holy Grail Layout , Angular 8/9
canonical_url: https://www.positronx.io/angular-css3-flexbox-holy-grail-layout/
---

The post [Build CSS3 Flexbox Holy Grail Layout in Angular 8/9](https://www.positronx.io/angular-css3-flexbox-holy-grail-layout/) appeared first on [positronX.io](https://www.positronx.io).

**This is a step by step guide on CSS3 Flexbox layout. This tutorial explains how to create Responsive Holy Grail layout in Angular 8/9 application.**

Holy Grail layout is a typical layout pattern refers to a web page. It has equal height columns with a fixed header and footer, and a contains three columns left side nav (navigation), main content (primary content block) and right side sidebar (ads or other content).

 [click here to read more](https://www.positronx.io/angular-css3-flexbox-holy-grail-layout/)
Is it safe to use Google APIs from Client-Side Javascript 🤔
Tags: help, javascript, api
Published: 2019-11-04 15:31:07

---
title: Is it safe to use Google APIs from Client-Side Javascript 🤔 ❓
published: true
tags: help , javascript , api
---

Today I was experimenting with APIs , and landed on <https://developers.google.com/drive/api/v3/quickstart/js> while learning about Google Drive API. After reading the code example on that page , I was concerned about exposing my API Key and Client ID to public.

```html
<!DOCTYPE html>
<html>
  <head>
    <title>Drive API Quickstart</title>
    <meta charset="utf-8" />
  </head>
  <body>
    <p>Drive API Quickstart</p>

    <!--Add buttons to initiate auth sequence and sign out-->
    <button id="authorize_button" style="display: none;">Authorize</button>
    <button id="signout_button" style="display: none;">Sign Out</button>

    <pre id="content" style="white-space: pre-wrap;"></pre>

    <script type="text/javascript">
      // Client ID and API key from the Developer Console
      var CLIENT_ID = '<YOUR_CLIENT_ID>';
      var API_KEY = '<YOUR_API_KEY>';

      // Array of API discovery doc URLs for APIs used by the quickstart
      var DISCOVERY_DOCS = ["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"];

      // Authorization scopes required by the API; multiple scopes can be
      // included, separated by spaces.
      var SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly';

      var authorizeButton = document.getElementById('authorize_button');
      var signoutButton = document.getElementById('signout_button');

      /**
       *  On load, called to load the auth2 library and API client library.
       */
      function handleClientLoad() {
        gapi.load('client:auth2', initClient);
      }

      /**
       *  Initializes the API client library and sets up sign-in state
       *  listeners.
       */
      function initClient() {
        gapi.client.init({
          apiKey: API_KEY,
          clientId: CLIENT_ID,
          discoveryDocs: DISCOVERY_DOCS,
          scope: SCOPES
        }).then(function () {
          // Listen for sign-in state changes.
............. ✂️ ...........
```

## So, **Is it really safe to use code like this in public facing production webapps? 🤔🤔**