teleren/devto huggingface dataset:
Update 1 - Hardcore Year - from $0 to $100,000 ARR SaaS
Tags: startup, analytics, sideprojects
Published: 2020-11-18 15:57:17

Some time ago I posted my initial video about 100K challenge: https://youtu.be/wWHkC_txRVE

Here is my first update video: https://www.youtube.com/watch?v=H4lvccVGUpo

I'm sharing my Google Analytics, Admin panel and Search console data. Let me know what you think about it. If you want to support my project, please subscribe, like and comment.

Cheers!
Testing Laravel Breeze Authentication
Tags: laravel, php, phpunit, breeze
Published: 2020-11-18 13:03:52

Laravel Breeze is a new and surprising laravel package developed by Taylor Otwell himself and released just a few days ago.

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Surprise package release. When? Now! Laravel Breeze. If Jetstream overwhelmed you and you need something simpler for now. Blade + Tailwind only. Every route and controller exported directly to your application. Same beautiful Jetstream style UI. <a href="https://t.co/V3QMrVzY0p">https://t.co/V3QMrVzY0p</a> 🌴🌊🌴</p>&mdash; Taylor Otwell 🛸 (@taylorotwell) <a href="https://twitter.com/taylorotwell/status/1325890243493556224?ref_src=twsrc%5Etfw">November 9, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

What this package provides is the more low-level auth scaffolding UI using Tailwind and AlpineJS, which the old `laravel-ui` auth scaffolding is using either Bootstrap, Vue or React.

## Installing the package

The best way to try this package is by using a new and freshly created laravel app and installing the package using:

```
composer require laravel/breeze --dev
```

and then scaffold the auth feature using

```
php artisan breeze:install
```

and then also make sure to build the assets by:

````
npm install
npm run dev
```

and then the login and register are ready to use.

![laravel breeze login page](https://dev-to-uploads.s3.amazonaws.com/i/xyz3xjmc8l3140lhvy5v.png)

![laravel breeze register page](https://dev-to-uploads.s3.amazonaws.com/i/an82apkiup1onvm9tpjb.png)

![laravel breeze dashboard page](https://dev-to-uploads.s3.amazonaws.com/i/zgwhmvws4niarey471y2.png)

## Testing the package

My plan for this post is to make some `feature/unit tests` to test the login and register functionality as well as improving my `PHPUnit` testing skill. But `laravel/breeze` already provides all the test suites for us. 

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Breeze even exports a set of nice tests to your application... ✅ <a href="https://t.co/zxf9eVzLJu">pic.twitter.com/zxf9eVzLJu</a></p>&mdash; Taylor Otwell 🛸 (@taylorotwell) <a href="https://twitter.com/taylorotwell/status/1325891538279428097?ref_src=twsrc%5Etfw">November 9, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

So, I will learn from it instead.

To enable and try the `phpunit`, you can see in `phpunit.xml` file and uncomment these lines:

```xml
...
        <server name="DB_CONNECTION" value="sqlite"/>
        <server name="DB_DATABASE" value=":memory:"/>
...
```

and then you can run all tests using:

```
php artisan test
```

Laravel Breeze is a great starting point for your laravel project if you are already comfortable using Tailwind and the purge configuration is already set to use if you build your assets for production (`npm run prod`).

Have fun exploring this package.
Manipulating Keys in an Object Using Recursion
Tags: javascript, beginners
Published: 2020-11-18 15:55:32

It is no secret that Javascript was designed for object-oriented programming. Objects have the ability to store string, numeric and boolean values as well as functions (methods) in an easy to read and interpret way. Because understanding objects and how they work, or can be accessed, is a necessity in Javascript I would like to share an example of how you can manipulate an objects key to your will with the power of recursion!

###Recursively Replacing a Key in an Object	

In the event that you may need to replace a key in an object, you can use a short little function that cleverly uses recursion to replace the key in an object.
```
var replaceKeysInObj = (obj, key, newKey) => {
     let newObj = {};
     for (var ogKey in obj){
       if(ogKey === key) {
         newObj[newKey] = obj[ogKey]
    } else if (typeof obj[ogKey] === 'object') {
      newObj[ogKey] = replaceKeysInObj(obj[ogKey], key, newKey);
    } else {
      newObj[ogKey] = obj[ogKey]
    }
  }
  return newObj
};
```

*Here is a breakdown of the above function*

**Note** - *The three parameters are going to be the original object(obj), the key we are going to change(key), and the new key we are going to use to replace the old key(newKey)*.


***First***: we create a new variable(newObj)and set it to an object literal({}). We will use this new object literal for creating our new and improved key in the object.

***Second***:
```
for (var ogKey in obj){
       if(ogKey === key) {
         newObj[newKey] = obj[ogKey]
```

We use a for-in loop to see if the key in the object(ogKey) matches the key we are looking to replace(key). If it does then we are setting the new object key to the old object key.

***Third***: *time to use recursion*

```
else if (typeof obj[ogKey] === 'object') {
      newObj[ogKey] = replaceKeysInObj(obj[ogKey], key, newKey);
```

If the type of value for the object's original key is an object, then we set the value equal to the recursive case so it will also look inside of that object which is not just helpful... it's AWESOME.

***Forth***:
```
else {
      newObj[ogKey] = obj[ogKey]
    }
```

The final else, if the first two conditions aren't met, will set the new object's key/value equal to the original object's key/value. This will allow the rest of the object's keys that do not match the "newKey" to stay the same after the recursive calls.

***Fifth & Final***:

```
return newObj
};
```

We return the new object that has our updated key inside.

There is always another way to skin a cat (*lookup Object.assign*) but this way allows you to check through nested objects with **the power of recursion**!
Season of Docs, Meeting-12
Tags: github, docker, documentation
Published: 2020-11-18 15:54:40

On 11th of November, I had a meeting with my mentors with regards to Google's Season Of Docs project. The mentors had assigned the following tasks:-
1. Making the changes to the user docs, as per the discussions.
2. Making changes to the Installation page.
3. Removing the contents of the setup page and re-write the setup page. Also, adding the existing info on the setup page to the relevant sections of the user docs.
4. Adding the visualisation, download and submit plugins to the plugins sections and removing certain sections from the download table.

I was able to complete the following tasks:
1. Swapped the **Viewing** section with the **registering** section.
2. Added the **Searching on a record** sub-section under the search section.
3. Edited the **editing a submission** section. Added a few more details, which were missing as well as provided the explanations in a bit more detail.
4. Removed the content from the setup page and added it to the respective sections under the **admin** section.
5. Added the **visual**, **submit** and the **download** plugins to the respective sections, under the plugins section. 
6. Somewhat completed the **SBOlExplorer** section under the **admin** section.
7. Made the minor changes to the **installation** page as per the requirements. 

Following are the issues that I faced this week:
1. Was unable to install SynBioHub, with SBOLExplorer.
2. Was unable to get to the setup page. 
3. Still some sections in the admin section of the user docs are empty and I'll try to understand their significance in the next meeting. 

Further, I'll try and clear all my doubts, in the next meeting and have a brief discussion over the contents of **troubleshooting** section.
Apple to Reduce App Store Commissions for Small Businesses in 2021
Tags: news, apple, ios, discuss
Published: 2020-11-18 15:51:26

---
title: Apple to Reduce App Store Commissions for Small Businesses in 2021
published: true
description: Starting next year, Apple is reducing app store commissions from 30% to 15% for devs who make less than $1 million per year from their apps.
tags: news, apple, ios, discuss
//cover_image: https://direct_url_to_image.jpg
---

A friend pointed me to this tweet earlier today:

{% twitter 1329016778417205250 %}

Seems like great news for small independent app developers as their commission paid to Apple will be cut in half! That said, many claim this is just a gesture by Apple to appease critics.

[As reported on The Verge](https://www.theverge.com/2020/11/18/21573109/epic-tim-sweeney-apple-app-store-fee-cut-reduction-criticize), Epic and Spotify have released statements describing the move as "calculated", "divisive", "arbitrary", and "capricious". 

Creator of Ruby on Rails, DHH commented:

{% twitter 1329025709080195073 %}

So, what do you all think about this news? Are these cuts going to benefit you? How do you feel about the criticism?
Scale Your Data Science Teams With Machine Learning Operations Principles - Episode 289
Published: 2020-11-18 15:41:47

<p>Building a machine learning model is a process that requires well curated and cleaned data and a lot of experimentation. Doing it repeatably and at scale with a team requires a way to share your discoveries with your teammates. This has led to a new set of operational ML platforms. In this episode Michael Del Balso shares the lessons that he learned from building the platform at Uber for putting machine learning into production. He also explains how the feature store is becoming the core abstraction for data teams to collaborate on building machine learning models. If you are struggling to get your models into production, or scale your data science throughput, then this interview is worth a listen.</p><p><a href='https://www.pythonpodcast.com/machine-learning-operations-episode-289/'>Listen Now!</a></p>
IBM Carbon Design System
Tags: react, vue, angular, svelte
Published: 2020-11-18 15:40:01

Since Material design, everyone is at it, some companies have some really nice style, well heres a super cross-library component framework from IBM which got my blood pumping. you might digit too.

I am showing you the svelte version here but heres a bunch of support:
`react` `vue` `angular` `svelte` `javascript`

https://carbon-svelte.vercel.app/

Pretty!
Multicast Receive Script
Tags: linux, networking
Published: 2023-01-06 01:13:02

---
title: Multicast Receive Script
published: true
date: 2020-11-18 15:09:15 UTC
tags: Linux,Networking
canonical_url: https://brandonrozek.com/blog/multicastreceivescript/
---

I use `socat` to debug mutlicast traffic, though the syntax for it is complicated to learn. Here is the command that I normally use to debug multicast traffic.

```
socat UDP4-RECVFROM:"$port",ip-add-membership="$multicast_address":0.0.0.0,fork -

```

This says to:

- Listen to UDP traffic from `$port`.
- Subscribe to `$multicast_address`.
- `0.0.0.0` means to do it from the interface that matches the routing table for the multicast address.
- The rest makes it print the traffic to standard out.

To make life easier I created a little script called `mrecv` that takes a multicast address and port and forms the socat command for me.

```
#!/bin/bash

show_usage() {
    echo "Usage: mrecv [multicast_address] [port]"
    exit 1
}

contains_help_flag() {
    if ["$1" = "-h"] || ["$1" = "--help"]; then
        return 0
    fi
    return 1
}

if ["$#" -ne 2] ||
   contains_help_flag "$1" ||
   contains_help_flag "$2"; then
    show_usage
fi

multicast_address="$1"
port="$2"

socat UDP4-RECVFROM:"$port",ip-add-membership="$multicast_address":0.0.0.0,fork -

```
Sorting Strings in JavaScript with localCompare
Tags: javascript
Published: 2020-11-18 15:08:20

Take this list of strings:
```ts
let names = ['Lyra', 'Iorek', 'pantalaimon', 'Asriel', 'Serafina']
```
We want to sort it alphabetically. Naturally, we can [check the MDN for Array.prototype.sort()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort), and we find that `names.sort()` will do the job pain-free.

A week after you've submitted your work, a ticket is opened and assigned to you: *Users are complaining that their names aren't in the correct order*

After taking a look, you see that Lee has submitted his name in lowercase. *Of course he did.*

```ts
let names = ['Lyra', 'Iorek', 'pantalaimon', 'Asriel', 'Serafina', 'lee']
console.log(names.sort())
// Result ['Asriel', 'Iorek', 'Lyra', 'Serafina', 'lee', 'pantalaimon']
```
As you can see, users with lowercase names are sorted at the end. They're in order by themselves, but Product may not get your sense of humor when you explain it to them.

The reason lower case names are at the end has to do with their ASCII values. If you [check the chart](http://www.asciitable.com/), you'll see that lowercase letters have larger numerical ASCII values. Time to google *javascript sort strings ignore case*

Now we've been introduced to a new method, [localeCompare](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare). This method is packed with options that are available in all modern browsers. Check the usage chart at the bottom of the MDN page—some mobile browsers don't have full support for the options.

Here's the finished sort:
```ts
let names = ['Lyra', 'Iorek', 'pantalaimon', 'Asriel', 'Serafina', 'lee']
console.log(names.sort((a, b) => a.localeCompare(b, 'en', { sensitivity: 'base'})))
// result: ['Asriel', 'Iorek', 'lee', 'Lyra', 'pantalaimon', 'Serafina']
```
Angular: How would you create a Web Based Component Generator?
Tags: help, angular, typescript
Published: 2020-11-18 15:00:51

**Problem**

We have a reusable library of Angular components, most are GUI based, but not all

We want to create a way so all the available components are shown on the left aside in a list, and be able to drag them to an area that will represent our new component which contains those components. The new component is created as a container of the others. 

To get started we ignore the styling in the new component.

Any ideas on how to do this?
Navigating the World of Web Development
Tags: codenewbie, webdev, programming
Published: 2020-11-18 15:00:25

Near the end of 2019 after a discovery glimpse on Twitter, I decided to explore the tech world 👩🏾‍💻. Like any curious person does, I went down the rabbit hole of research. I DMed people and asked for advice on what direction to take. 

Thankfully they were kind enough to respond 🙏🏾, and I continued down my research rabbit hole. Now mind you, I studied Information Technology at university, but programming just never stuck and I never got in the tech field as intended. Anywho, the more I researched, I discovered "Tech Twitter", along with numerous blogs and YouTube videos on how to get into web development. 

Needless to say, I read everything. What I didn't immediately read was bookmarked 🔖  for later. Then comes the "I'm going to do EVERY course 😁" excitement. Insert 'signed up for several Udemy courses' and 'bookmarked every course/learning resource' here.

Care to guess what happened next❓

If you guessed information overload, overwhelm and analysis paralysis - yep, that's right. Then I started to feel discouraged with all the things I'd have to learn 😞. It's a lot! Yet every time I read someone's story through a tweet or blog, every time I watched a video, I'd be inspired to get into this industry too 😌. I decided I would be on this journey for the long haul, struggles and all.

Then I jumped into 2 different courses, tried to do 100 Days of Code twice, fell off and gave up. Add feeling discouraged because other developers who call themselves "newbies" are way ahead of you to that, and you get "Can I even do this?" Their version of newbie and my version of just starting newbie are two different things 😩. 

The developers I follow and admire are at minimum 1-3 years into their career. Plus, as a dev, you know many concepts aren't easy to understand and sometimes take a while to click in your head. I felt like giving up, though I never shared it. Seeing tweets from experienced developers encouraging beginners to "Keep going" and "It'll click, don't worry, just don't stop" became something I looked forward to daily 🙏🏾.

So far I've been staying on the learning journey, but also realise I wish I had an accountability partner who could relate to where I am on the path. What is refreshing though, is that the tech community is welcoming and supportive 💙. I'm learning to lurk less, not be afraid of being a beginner, find a non-judgemental community and learn in public.       

Thanks for reading! Until next time 👋🏾.
Payment gateway integration: why and how?
Published: 2020-11-18 14:56:37

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7mu6yf1s0emg8v25gmqo.png)
If you are an owner of an eCommerce website, you definitely look for new ways to increase revenue. And if you have not considered payment gateway integration yet, this article is a really good sign. 

**Payment gateway** is a service that aims to authorize credit cards or direct payments processing. It’s widely used either in eCommerce business or in standard brick and mortar shops. Principally, it’s a software application that connects a website and a bank. 

Figuring out how everything functionates will help you to find the best solution namely for your store. 

Here are 5 tips for merchants to choose a payment gateway:

1. Judge ease of integration;
2. Take into account customers reviews;
3. Detect funding speed;
4. Think about brandability;
5. Keep fees in mind. 

Now we turn to the following questions: why and how?

You might definitely need a payment gateway, since you will be able to receive payments straight from your clients, no matter if you own an online or brick and mortar shop. 

The biggest advantage is that you don’t have to worry about physical point of service to authorize and prove the transaction. Such a system is also convenient for your consumers: adding one more payment channel clearly attracts a bigger audience, as certain customers would gladly pay directly from their homes. 

Here is a brief description of the whole mechanism:

* Order confirmation and adding CC info;
* Data encryption for security reasons;
* Information being sent to credit card associations;
* Transaction approval or denial;
* If approved, changing status to authorized;
* Approval on the vendor’s side;
* Payment gets to the card issuing company;
* Payment’s sending to the relevant bank;
* Transaction confirmation and adding it to the cardholder’s statement. 

For more details about how to choose a gateway that will correspond to your needs please [follow this link](https://dinarys.com/blog/integrate-payment-gatewa-in-your-ecommerce-website).
Don't forget `as: :json` when testing JSON API
Tags: rails, ruby, rspec
Published: 2020-11-18 14:52:39

When you write tests for your JSON API with request spec,  typical code is like:

```ruby
describe 'POST /restaurants' do
  let(:params) { { name: 'pizza foobar' } }

  it 'creates a restaurant' do
    post '/restaurants', headers: headers, params: params
    expect(response).to have_http_status(:created)
    expect(response.parsed_body).to match(
      'id' => String,
      'name' => 'pizza foobar'
    )
  end
end
```

But this doesn't test the API right, technically.

Because this test sends a POST request with `application/x-www-form-urlencoded`, not `application/json`.

Mostly, you expect request body with `application/json` for JSON API. This code does not simulate requests properly.

So, use `as: :json` option:

```ruby
post '/restaurants', headers: headers, params: params, as: :json
```

I'm lazy enough to avoid passing `as: :json` every time.  
Usually I override those helpers to pass `as: :json` option by default:

```ruby
module RequestHelper
  %i[get post patch put delete].each do |method_name|
    define_method(method_name) do |path, args = {}|
      default_options = { as: :json }
      process method_name, path, default_options.merge(args)
    end
  end
end

RSpec.configure do |config|
  config.include RequestHelper, type: :request
  # ...
```
Malware Classes
Tags: computerscience, systems, virus
Published: 2020-11-18 14:42:48

Malware Classes
Class	Description
Virus: Code that propagates (replicates) across systems with user intervention
Worm: Code that self-propagates/replicates across systems without requiring user intervention
Bot: Automated process that interacts with other network services
Trojan: Malware that is often disguised as legitimate software
Ransomware: Malware that holds the victim's data hostage by cryptography or other means
Rootkit: Masks its existence or the existence of other software
Backdoor: Enables a remote attacker to have access to or send commands to a compromised computer
RAT: Remote Access Trojan, similar to a backdoor
Info Stealer: Steals victims information, passwords, or other personal data
HackTool: Admin tools or programs that may be used by hackers to attack computer systems and networks. These programs are not generally malicious
Hoax: Program may deliver a false warning about a computer virus or install a fake AV
Dropper/Downloader: Designed to "install" or download some sort of malware
Adware:	Automatically renders advertisements in order to generate revenue for its author.
PUP/PUA: Potentially Unwanted Program, sometimes added to a system without the user's knowledge or approval
Get the current position of the cursor on the page
Tags: javascript, webdev
Published: 2020-11-19 15:02:17

---
title: Get the current position of the cursor on the page
published: true
date: 2020-11-18 14:41:58 UTC
tags: javascript, webdev
canonical_url: https://phongduong.dev/blog/get-the-current-position-of-the-cursor-on-the-page/
---

To get the current position of the cursor on the page, you retrieve `pageX` and `pageY` property of the `MouseEvent` interface. These properties are the X and Y coordinates of the event on the document. They are in pixels and relative to the left and top edges of the document.

```javascript
document.addEventListener("mousemove", ({ pageX, pageY }) => {
   console.log(pageX, pageY)
});
```

These positions can change if you scroll the page. For example: if you scroll the page down 800px and move the cursor to 200px from the top edge of the document, `pageY` returns 1000.
Wednesday Links - Edition 2020-11-18
Tags: java, spring, servicemesh, jvm
Published: 2020-11-18 14:34:14

Move your mTLS configuration from the codebase to a service mesh! (5 min read) 💡
https://dev.to/piotrekst/move-your-mtls-configuration-from-the-codebase-to-a-service-mesh-50dg

Getting Started with Spring Data Specifications (7 min read) 📝
https://reflectoring.io/spring-data-specifications/

Spring Data 2020.0 - New and Noteworthy in Spring Data R2DBC 1.2 (3 min read) 🎉
https://spring.io/blog/2020/11/18/spring-data-2020-0-new-and-noteworthy-in-spring-data-r2dbc-1-2

Spring Boot 2.4.0 available now (3 min read) 🎉
https://spring.io/blog/2020/11/12/spring-boot-2-4-0-available-now

Announcing Spring Data Neo4j 6.0 (4 min read) 🎉
https://neo4j.com/blog/announcing-spring-data-neo4j-6-0

Announcing GraalVM 20.3 (7 min read) 🎉
https://medium.com/graalvm/graalvm-20-3-is-available-d2a7f7a2bbcd

The how of monitoring your services (4 min read) 🔍
https://blog.codecentric.de/en/2020/11/the-how-of-monitoring-your-services/

Are Package Registries Holding Open-Source Hostage? (5 min read) 🔫
https://about.scarf.sh/post/package-registries-and-open-source

JEP 389: Foreign Linker API (11 min read) 🔗
https://openjdk.java.net/jeps/389

NUMA-Aware Memory Allocation for G1 GC (5 min read) 🖐️
https://sangheon.github.io/2020/11/03/g1-numa.html

Project Loom: Scalable, Harmonious Concurrency for the Java Platform (1h 10 min) 🧵
https://www.youtube.com/watch?v=zuc9JZz9Xbw&t=609

Secrets of the Shenandoah Garbage Collector (26 min) ㊙️
https://www.youtube.com/watch?v=WcSqLvxwzbA