teleren/devto huggingface dataset:
BaaS: Blockchain-as-a-Service 
Tags: blockchain, devops, devjournal
Published: 2021-02-03 02:43:25



BaaS, also known as Blockchain as a service is used by companies or enterprises that build blockchain applications to manage cloud-based networks. Blockchain application has evolved from being just to handle cryptocurrency transactions to securing transactions of different kinds. BaaS is a third-party service that is new to the rapidly growing field of blockchain. It runs the back-end operations for blockchain apps like a web host. With BaaS, the adoption of blockchain is most likely to skyrocket.


BaaS is adopted from the software as a service (SaaS) model and they both have the same similarity in their functions. It allows people to utilize cloud-based solutions to build, host, and operate their own blockchain apps, platforms and other related functions on the blockchain. At the same time, the cloud-based service provider keeps infrastructure agile and operational.


## Major Key Players in the BaaS space include:

* Microsoft partnered with ConsenSys to introduce Ethereum blockchain-as-a-service on Microsoft Azure in 2015.﻿
* R3 produced a distributed financial ledger called Corda.
* Amazon introduced Amazon Managed Blockchain, using open source frameworks including Ethereum and Hyperledger Fabric

Blockchain is fast evolving and businesses and consumers are willing to adapt to blockchain technology. However, there are technical complexities involved in creating, configuring, and operating, maintaining a blockchain and its infrastructure, this often acts as a barrier. This is where Baas comes in. BaaS offers an external service provider to set up all the necessary blockchain technology and infrastructure for a fee. Once created, the provider continues to handle the complex back-end operations for the client.

The BaaS operator offers technical support, such as managing bandwidth, allocating resources, hosting requirements, data security etc. 

## Choosing the right BaaS Platform:
* Smart Contracts Integration: Smart contract is required to integrate business logic into your blockchain solution. Smart contracts include the rules and penalties just like typical contracts, 
It is important to remember that the BaaS provider provides smart contract integration as one of its services.
* Different Runtimes and Frameworks: Ensure to choose a BaaS provider that supports a diverse range of runtime and because some BaaS providers only support one kind of enterprise blockchain deployment.
* Identity Access Management: To manage identities,  a single sign-in method or even multiple authentication ways can be used to give users access to the information. Ensure to select a BaaS platform that offers IAM framework integration.

## Conclusion
As the blockchain field rapidly, Blockchain as a service(BaaS) has the ability to boost blockchain adoption across businesses.
1 line to prevent pushing to someone else's git repository
Tags: git, safety, rudderstack
Published: 2021-02-03 01:49:21

---
title: 1 line to prevent pushing to someone else's git repository
published: true
description: a little safety never hurt anyone
tags: git, safety, rudderstack
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/05x857bzviogmy6ogr7f.jpg
---

*cover image by [D.D. Fire](https://commons.wikimedia.org/w/index.php?curid=85880438)*


The other day I attempted to push to a public repository for about the hundredth time. This time I finally thought to search for a way to prevent this happening, and of course I found the answer [on stack overflow](https://stackoverflow.com/questions/10260311/git-how-to-disable-push)

The following command will let pulls work, but pushes will try to use the URL no_push and fail:

```bash
git remote set-url --push origin no_push
```

use it in good health!
I'm going to make Gradle docs on DEV.
Tags: gradle, watercooler, java, groovy
Published: 2021-02-03 01:44:35

So, all the docs and tutorials I've seen are very verbose, and not very specific. So, when I learn enough, I want to start posting docs here in a style similar to how MDN picks apart HTML, CSS, and JS. Hopefully, once I write them, they will be a help to whoever learns Gradle after me.

All posts will contain the tags: `groovy`, `gradle`, `java`, and `beginners`.
Day 2 - 66 Days of Data Science
Tags: devjournal
Published: 2021-02-03 01:43:50

Yesterday I learned that the first step of mastering statistics is to master the art of exploring data.

## Exploring Data Types

Categorical data is data that can be in groups. They are labels. In the R programming language, they are called factors. Generally categorical data you will use a bar chart or pie chart to explore data. The distribution of categorical data are counts, frequency, or percentage. 

For quantitative data, you would use a histogram, line chart, or stem plot ( only if the data is small).

## Exploratory Data Analysis (EDA) workflow

- Study each individual variable
- Study the relationships between two variables
- Create graphs of the distribution of variables
- Last, add numerical summaries of specific aspects of data

Four things to measure the distribution of a variable shape, center, spread, and outliers.

Measures of center - mean and median
Measures of spread- quantile ranges

spread + center gives useful information about the distribution of the data.
shape- the data can have a normal distribution like a bell curve, or can be skewed to the right or left

Tools for finding outliers
standard deviation - measures how much a data point is away from the mean
XCEL Workflow Management App Development: A Rewarding and Challenging Experience
Tags: react, javascript, node
Published: 2021-02-03 01:42:32

Last month I started labs at Lambda School. I was formed into a group with 6 other people. We were tasked with coming up with a workflow management app where tenants can create a work ticket for any issues they have in their apartments. This project did take us a little while to get going as we had to create wireframes of how we wanted the site to work. After we built out how we wanted the site to look we ended up breaking into two groups one that would work on the back-end of the site and one for the front-end. I ended up wanting to work on the front-end of the site.

##Working on the app

While working on the app my group and I started to delegate what work needed to get done. I drew the short straw and had to come up with how to implement our state management. Ultimately I chose redux as I think it has better scalability than the context api. I was able to code up all of the redux components in a couple of days.

While working on our app one of our group members pretty much vanished leaving me and my other group member to pull up the slack and get done his portion. Thankfully we were able to get into contact with the other guy after about 3 days of just silence. We gave him the styling to do just in case if he decided to go dark again. We were then able to finish the first release of the app without any more issues.

##Looking towards the future

Our release 1 was finished this past week and we got a working app. The users can sign in using okta and oAuth to authenticate themselves on the server. The users can then go into their own dashboard to look and see what tickets they have assigned to them. From the dashboard they will be able to go and create tickets for maintenance to work on.

In the next couple releases of the app we are looking into using an api to send users either emails or text messages to confirm someone is coming out to work on their issue. In release 2 we are also going to have priority levels and have workers get assigned to tickets. So far the future is looking bright for this work order app.
Teeny.go, a route system for Go (Golang)
Tags: go, routing, http
Published: 2021-02-03 01:12:50

Teeny.go (or teenygo or only teeny) is a micro-module for create a micro-webserver with support for routes and routes with patterns similar to PHP and JavaScript web-frameworks

For install use

```
go get -u github.com/inphinit/teeny.go
```

Then create a file with any name and extension .go, example foo.go and put this content:

``` golang
package main

import (
    "fmt"
    "net/http"
    "github.com/inphinit/teenygo"
)

func main() {
    app := teeny.Serve("localhost", 7000)

    app.Action("GET", "/", func (response http.ResponseWriter, request *http.Request) {
        fmt.Fprint(response, "Homepage")
    })

    app.Action("GET", "/about", func (response http.ResponseWriter, request *http.Request) {
        fmt.Fprint(response, "About page")
    })

    app.Exec()
}
```

For execute local serve run this command:

```
go run foo.go
```

For build executes:

```
go build foo.go
foo
```

This is a very simple example, for access `http://localhost:7000/` and `http://localhost:7000/about`

# Handling Http errors (like `ErrorDocument`)

For handling errors for not defined routes (404 Not Found) and when try access a route with invalid (not defined) method uses `app.HandlerCodes(codes []int, func TeenyStatusCallback)`, example:

``` golang
func main() {
    app := teeny.Serve("localhost", 7000)

    var codes = []int {404, 405}

    app.HandlerCodes(codes, func (response http.ResponseWriter, request *http.Request, code int) {
        fmt.Fprintf(response, "Error %d", code)
    })

    ...
}
```

# Route patterns

For use patterns in router uses `app.Params(method string, path string, func TeenyPatternCallback)`, example with `num` and `alnum` pattern:

``` golang
    app.Params("GET", "/users/<id:num>/<name:alnum>", func (response http.ResponseWriter, request *http.Request, params map[string]string) {
        fmt.Fprint(response, "Params:\n")

        for key, value := range params {
            fmt.Fprintf(response, "%s = %s\n", key, value)
        }
    })
```

Supported patterns:

Pattern | Regex used | Description
--- | --- | ---
`alnum` | `[\da-zA-Z]+` | Matches routes with param using alpha-numeric in route
`alpha` | `[a-zA-Z]+` | Matches routes with param using A to Z letters in route
`decimal` | `\d+\.\d+` | Matches routes with param using decimal format (like `1.2`, `3.5`, `100.50`) in route
`num` | `\d+` | Matches routes with param using numeric format in route
`noslash` | `[^\/]+` | Matches routes with param using any character except slashs (`\/` or `/`) in route
`nospace` | `\S+` | Matches routes with param using any character except spaces, tabs or NUL in route
`uuid` | `[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}` | Matches routes with param using uuid format in route
`version` | `\d+\.\d+(\.\d+(-[\da-zA-Z]+(\.[\da-zA-Z]+)*(\+[\da-zA-Z]+(\.[\da-zA-Z]+)*)?)?)?` | Matches routes with param using [`semver.org`](https://semver.org/) format in route
Go |> Generate และ Parse UUID ด้วย package "github.com/google/uuid"
Tags: go, programming
Published: 2021-02-03 01:08:31

[UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) ย่อมาจาก Universally Unique IDentifier เป็นลำดับของตัวเลขและตัวอักษร ที่ตามอัลกอริทึมมันเนี่ย โอกาสที่จะซ้ำกันยากมาก ใน WIKI บอกเอาไว้ว่า 

> Thus, the probability to find a duplicate within 103 trillion version-4 UUIDs is one in a billion. 

ซึ่งคือถวามน่าจะเป็นน้อยมากๆ

ทีนี้ถ้าใครอยากใช้ UUID ใน Go ก็มี package นึงจาก google เองคือ package [`"github.com/google/uuid"`](https://pkg.go.dev/github.com/google/uuid) ที่ช่วยเรา generate UUID แล้วก็ช่วย Parse จาก string ให้กลายเป็น `uuid.UUID` ให้ด้วย นอกจากนั้นตัว type `uuid.UUID` ก็ยัง implement Mashal/Unmarsal เอาไว้ทำให้ใช้กับ `encoding/json` package แล้วมันจัดการแปลงเป็น string ให้เองแล้วด้วยตอนทำ `json.Mashal` หรือแปลงกลับมาเป็น `uuid.UUID` เองตอนทำ `json.Unmarshal`

## Generate new UUID
วิธีสร้าง UUID ค่าใหม่ก็ใช้ง่ายๆคือเรียก `uuid.New()` เช่น

```go
package main

import (
	"fmt"

	"github.com/google/uuid"
)

func main() {
	for i := 0; i < 10; i++ {
		id := uuid.New()
		fmt.Println(id)
	}
}
```

```
$ go run main.go
f1cf86f5-c5ad-47ba-baf1-9ca646b91148
8cd3fc0b-7299-4a7c-a90a-1db749e01c20
e5c26dcb-8c6d-43c1-bc24-f4e195d78299
910dfb0d-202e-4a17-b6f0-c4e03c45bede
162da813-92f5-41fb-b1fd-4e2d1a809345
ff7f7b7a-167f-4f0d-8192-06c9df67b6dc
b752f0c3-908b-49fb-b6c6-01d33c0eb2a3
da4dfe12-8661-41b9-8a1c-ffebab5ff537
b8d9b607-49c1-4900-9674-a7746f270a39
ddd85702-90e1-419c-8afd-b79c1fde37fd
```

## Parse string to uuid.UUID
ทีนี้ถ้าเรามี string ที่อยู่ใน format UUID เช่น `ddd85702-90e1-419c-8afd-b79c1fde37fd` ที่อาจจะมาใน request path param เราสามารถแปลงเป็น `uuid.UUID` type ได้โดยใช้ฟังก์ชัน `uuid.Parse` แบบนี้

```go
package main

import (
	"fmt"
	"log"

	"github.com/google/uuid"
)

func main() {
	strID := "ddd85702-90e1-419c-8afd-b79c1fde37fd"
	id, err := uuid.Parse(strID)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%T\n", id)
	fmt.Println(id)
}
```

```
$ go run main.go
uuid.UUID
ddd85702-90e1-419c-8afd-b79c1fde37fd
```

ยังมีฟังก์ชันอื่นๆในการใช้งาน package "github.com/google/uuid" อีก สามารถดูกันต่อได้ที่ document ของ package ที่ลิ้งนี้ https://pkg.go.dev/github.com/google/uuid

## ขอฝาก Buy Me a Coffee
สำหรับท่านใดที่อ่านแล้วชอบโพสต์ต่างๆของผมที่นี่ ต้องการสนับสนุนค่ากาแฟเล็กๆน้อยๆ สามารถสนับสนุนผมได้ผ่านทาง Buy Me a Coffee คลิ๊กที่รูปด้านล่างนี้ได้เลยครับ

<a href="https://www.buymeacoffee.com/weerasak" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

ส่วนท่านใดไม่สะดวกใช้บัตรเครดิต หรือ Paypal สามารถสนับสนุนผมได้ผ่านทาง PromptPay โดยดู QR Code ได้จากโพสต์ที่พินเอาไว้ได้ที่ Page DevDose ครับ https://web.facebook.com/devdoseth

ขอบคุณครับ 🙏
Deploy Nuxt.js on DigitalOcean App Platform in 5 minutes or less
Tags: devops, webdev, javascript, nuxt
Published: 2021-02-03 00:52:03

I recently find myself deploying more and more projects using the DigitalOcean App Platform because it is so damn quick. I love writing Dockerfiles and deploy my containers to a Kubernetes cluster, but with a Platform-as-a-Service solution such as AWS Elastic Beanstalk or the aforementioned solution by DigitalOcean which is even easier to use, I feel like I really don't need to. I've used Elastic Beanstalk in the past, but the pricing always was a bit too high for small projects. With the great usability and pricing of the DigitalOcean App Platform, I started deploying side-projects there. Today I tried deploying a Nuxt installation to App Platform for the first time and found a small hurdle, that somehow wasn't really documented in any tutorial. So here we go!

*I assume, that you have basic devop knowledge, including DNS servers, environment variables, and stuff.*

# 1. The container

That's easily the best part. **You don't need one,** because you can use the default Node container provided to you by DigitalOcean :thumbsup:

# 2. The repository

DigitalOcean App Platform deploys your apps right from their respective git repositories. So, assuming you already have a Nuxt.js project in a GitHub or GitLab repository, you can jump right in: [Go to your DigitalOcean Admin Panel](https://cloud.digitalocean.com)

# 3. Set up your DigitalOcean App

- Hit the big green 'Create' button and start creating a new 'app'.
- Connect your GitHub or GitLab account if you haven't already. Select the repository containing your Nuxt.js project below and click 'next'.
- Choose a name and region and proceed to the next step. Here, we have a few settings to make. DigitalOcean should have detected the Node environment.
- We want to deploy it as a Web Service.
- You can set the environment variables if you need any.

# 4. Getting health checks right

This is the only problem I stumbled upon. To get health checks working, we need to change the default run command:

- The build command should be `npm run build` – fine!
- The run command should be `npm start` by default, but we need to change it to `npm start -- --hostname 0.0.0.0`
- The default Nuxt.js port is `3000` so we need to either change the port in the app platform setting, or set the run command to `npm start -- --hostname 0.0.0.0 --port 8080`. Chose what you like better. I went with 3000.

# 5. Set up your domain

Finish the setup and wait for the deployment to complete. With the health checks set up properly, there shouldn't be any issues. Once that is done, you can make more adjustments to your app settings, like connecting your domain.

I hope this was helpful :rocket:
Learning Blog: Kotlin Flows
Tags: android
Published: 2021-02-03 00:45:14

Tutorial: [Ray Wenderlich](https://www.raywenderlich.com/9799571-kotlin-flow-for-android-getting-started)

# About
Kotlin Flows are a Kotlin implementation of Reactive Stream.
It is quite powerful and has the potential to remove the need for RxJava for Android projects.
Meteor Monthly Wrap-Up Podcast
Tags: javascript, opensource, devops, react
Published: 2021-02-03 00:41:53

Hi everyone,

The fourth episode of our Meteor Monthly Wrap-Up podcast is up! In this latest episode, Filipe and Matt discuss the launch of Meteor Cloud, as well as some additional details on the Meteor 2.0 release.

There was a lot to cover in this episode, so we definitely recommend you check it out. Click on the link below to download and listen.

Let me know if you have any questions!

-Elysse

https://podcast.meteor.com/episodes/meteor-monthly-wrap-up-meteor-cloud-and-20-release
Evolutionary dead-ends (finding childless descendants aka leaf nodes)
Tags: javascript, functional, recursion
Published: 2021-02-03 00:02:40

---
title: Evolutionary dead-ends (finding childless descendants aka leaf nodes)
published: true
description: 
tags: javascript, functional, recursion  
---
There goes the bloodline ☹️

In the following examples `get_n_children()` returns the number of children the actor has and `get_children()` returns the children as an array.

Method 1: Standard recursion

```javascript
function get_childless_descendants(actor) {
    const leafs = []
    recurse(actor)
    return leafs
    function recurse(actor) {
        if (actor.get_n_children()) {
            actor.get_children().forEach(recurse)
            return
        }
        leafs.push(actor)
    }
}
```

Method 2: Functional using a recursive reducer

```javascript
function get_childless_descendants_using_reduce(actor) {
    const leafs = (acc, cur) => cur.get_n_children() 
        ? cur.get_children().reduce(leafs, acc) 
        : [...acc, cur]
    return leafs([], actor)
}
```

Method 3: Functional using a recursive flatMap

```javascript
function get_childless_descendants_using_flatMap(actor) {
    const leafs = (actor) => actor.get_n_children() 
        ? actor.get_children().flatMap(leafs) 
        : [ actor ]
    return leafs(actor)
}
```

TODO: What happens when the tree is large? Recursion is expensive - an iterator/generator version could be used to find the leaf nodes one at a time, on demand.

Do you have another method?
Video: Copy HTTP Requests from Chrome/Edge DevTools to PowerShell/cURL/Fetch
Tags: web, chrome, edge
Published: 2021-02-03 17:11:08

---
title: Video: Copy HTTP Requests from Chrome/Edge DevTools to PowerShell/cURL/Fetch
published: true
date: 2021-02-03 00:00:00 UTC
tags: web, chrome, edge
canonical_url: https://swimburger.net/blog/web/video-copy-http-requests-from-chrome-edge-devtools-to-powershell-curl-fetch
cover_image: https://swimburger.net/media/riyflxyz/chrome-edge-powershell-social.png?anchor=center&mode=crop&width=1000&height=420
---

As we develop websites, apps, and services, we make many HTTP requests from the browser to the server. During debugging sessions, replaying HTTP requests can take a lot of manual effort. For example, filling out multiple forms to ultimately hit that submit-button or going through a long wizard.

Google Chrome and Microsoft Edge DevTools can speed up your inner loop by copying recorded HTTP requests as PowerShell, cURL, or Fetch. Check out this video to learn how to use this feature and see it in action:

{% youtube mMjzEI27xDI%}

If you prefer written content, check out my blog post: [Copy HTTP Requests from Chrome/Edge DevTools to PowerShell/cURL/Fetch](https://swimburger.net/blog/web/copy-http-requests-from-chrome-edge-devtools-to-powershell-curl-fetch).
How to scroll to a specific position in a browser window using JavaScript?
Tags: javascript
Published: 2021-02-03 00:00:00

---
  title: How to scroll to a specific position in a browser window using JavaScript?
  published: true
  tags: JavaScript
  date: Wed Feb 03 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/scroll-to-specific-position-in-window-using-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-480ef6d3ac4dd6f9535bc5ea2b98a114.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/scroll-to-specific-position-in-window-using-javascript)
  
To scroll to a specific position in the browser window, you can use the `scrollTo()` method in the global `window` object in JavaScript.

For example, to scroll 100px from the top of the page, you can pass `0` as the first argument (X Coordinate) and `100` as the second argument (Y Coordinate)to the `scrollTo()` method like this,

```js
// Scroll 100px from top of the page 🌟
window.scrollTo(0, 100);
```

The `scrollTo()` method accepts 2 arguments:

- The first argument is the `X Coordinate` to scroll.
- The second argument is the `Y Coordinate` to scroll.

See this example live in [JSBin](https://jsbin.com/tusagexawu/1/edit?html,js,console,output).

### Feel free to share if you found this useful 😃.

---
Launching Selenium with JavaScript Disabled
Published: 2021-03-04 13:51:22

---
title: Launching Selenium with JavaScript Disabled
published: true
date: 2021-02-03 00:00:00 UTC
tags: 
canonical_url: https://datawookie.dev/blog/2021/02/launching-selenium-with-javascript-disabled/
---

![](https://datawookie.dev/img/headers/banner-selenium.png)

I have a rather obscure situation where I want to launch Selenium… but with JavaScript disabled.

```
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
```

After a bit of Googling it turns out that this is eminently possible by just setting some options prior to launching the browser.

```
chrome_options = Options()
chrome_options.add_experimental_option(
  "prefs",
  {
    'profile.managed_default_content_settings.javascript':2
  }
)
```

Now create a browser instance.

```
browser = webdriver.Remote(
    "http://127.0.0.1:4444/wd/hub",
    DesiredCapabilities.CHROME,
    options=chrome_options
)
```

Head over to [https://www.whatismybrowser.com/detect/is-javascript-enabled](https://www.whatismybrowser.com/detect/is-javascript-enabled) to check.

```
browser.get("https://www.whatismybrowser.com/detect/is-javascript-enabled")
```

![](https://datawookie.dev/blog/2021/02/launching-selenium-with-javascript-disabled/whatismybrowser-javascript.png)

Looks good. Success!

**Note:** This has been tested with:

- `selenium/standalone-chrome-debug:3.141`.
Freebie: Animated website header generator
Tags: javascript, html, webdev, design
Published: 2021-02-02 23:52:26

Hi Everyone, I put together a [tool](https://www.finisher.co/lab/header) that lets you quickly create animated website headers. It was inspired by the very cool Stripe.com header, but the page I'm sharing can produce countless header combinations. It's entirely free and the JS script itself is lightweight (2Kb gzipped), so feel free to use it for you own projects. No attribution is needed, but backlink is always appreciated:) Enjoy!

https://www.finisher.co/lab/header

#### Below are examples of what kind of headers the page can generate

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wgcqeyvsw4iklae49md2.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mz7nfd28d4v3ug443v55.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0fpulv2m58n7hs9m8zg1.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hlsgozidknbvo0ipyns7.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lqc3dzytf2upl173msaf.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l4zc3zlnu8gy58gok18x.png)