teleren/devto huggingface dataset:
Content SaaS | Integration with Youtube
Published: 2022-11-14 09:08:55

Recently Bloomreach Content (SaaS) released a feature, [Integrations Library - UI Extensions](https://documentation.bloomreach.com/content/docs/integrations-library). By using this feature, you can add your document field extensions as a custom integration. This opens up new possibilities to create content-type fields of your own.

In the following example, we will show you how the "Youtube integration" works from a functional point of view and how to install this as a developer.

When the Youtube integration is enabled in your Bloomreach Content SaaS channel you can add a component and browse through the youtube video catalog. Free text search is available to filter the results and with the returned results, whenever you hover over the thumbnail you will see a video preview. Click on the video element to add the youtube video link to your page.

{% embed https://www.youtube.com/embed/bIdymg1xRJ0 %}

The integration can also be configured to **only** show videos from a particular youtube channel.

## Installing the Youtube integration as a Developer

When adding the custom integration through the "integrations" dashboard make sure to add the following parameters:

Application URL: `https://youtube-integration.bloomreach.works/`
Configuration: `{"apiKey":"[youtube-api-key]"}`
Height: `170`
CSP:

```
frame-src:["youtube-integration.bloomreach.works","www.youtube.com"]
```


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mw4huwbcm2xybye1i5z3.png)

#### Configure the integration to allow browsing through a single youtube channel:

Configuration: `{"apiKey":"[youtube-api-key]", "channelId" : "[your-channel-id]"}`

#### OpenUI String field
An Open UI String field uses the document field extension point to display a custom field type.
When a Youtube integration is available, document editors can add an Open UI String field to the desired document type and link it to the integration, using the UI extension drop-down like below.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fbuufskepicyuvtaj27.png)

Once the Open UI String field is correctly configured, editors are able to include Youtube videos directly within the document or component field group.
Magento 2 Delivery Date Extension Helps to Simplify Delivery Operations
Published: 2022-11-14 08:53:22

Magento 2 Delivery Date extension allows customers to select their desired date and time for their orders. In recent years, whereas eCommerce has been positively competitive, it is known that selling quality products is not the most important factor for success. 

Customers need more advanced services than standard Magento 2 delivery options, such as immediate shipping or shipping on a specific date. This Magento 2 Delivery Date Extension is one of the best solutions to streamline order management and provide a great purchasing experience.


![Magento 2 Delivery Date Extension Helps to Simplify Delivery Operations](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s92x7crmmcalv9m84lyb.png)

### Why Do You Need It?
You can enhance customer retention rates by delivering products at the convenience of customers. "A 5% increase in customer retention rate can raise your business profits by 25% to 95%."

- **Admin Notification:**

The admin receives mail notifications instantly when a customer selects a delivery time. These notifications alert the administrator to begin processing the delivery job immediately.

- **Sorting Out:**

In real-time, administrators can serialize commands from the backend. By sorting the orders, the administrator can analyze which time slot is busiest and allocate resources accordingly.

- **Manage Delivery Time Slots:**

When you're running a marketplace, delivery times may vary from store to store. You can have a different delivery time slot for each store, and these slots can be easily managed through [Magento 2 Delivery Date extension](https://store.webkul.com/Magento2-Delivery-Date-Time-Schedule.html).

- **Disable Time Slot:**

The administrator can also disable the time slot if resources are unavailable or if there is another problem. In such cases, the customer cannot choose those inefficient time slots for delivery.

- **Customized Frontend Theme:**

Attract your customers with an attractive UI design, as we offer a wide variety of front-end themes. Another interesting aspect is that these themes can be customized to your liking.


**The following are the general characteristics of the Magento 2 Delivery Date Extension:**

- Customers can choose their preferred date and time for delivery.
- Customers can also add information about the time of booking i
n the comment text box.
- Customers receive confirmation emails after booking a time slot.
- The administrator can modify the delivery date formats to be displayed in front.
- Admin can submit delivery details to customers through confirmation mail.
- The installation process is done by our experts for free.

### Final Words:

Magento 2 delivery date extension helps set the minimum and maximum duration for shipment. This [Magento 2 extensions](https://store.webkul.com/Magento-2.html) authorizes the customers to decide their shipping day and time as per their requirements and availability, as well as allows customers to write comments about the shipment.
Ng-News: Episode 22/45
Tags: angular, javascript, webdev, programming
Published: 2022-11-14 08:42:03

Minko Gechev, recently promoted to Angular product lead, talked about the upcoming release 15 and the future developments. ng-conf published all recordings from this year's conference.

{% embed https://youtu.be/_Act5vVcF3c %}

## Minko Gechev on the Future of Angular

The planned release of Angular 15 is on Wednesday. That is the 16th of November.

This information came at the JetBrains JavaScript Day from the newly promoted Angular product lead: Minko Gechev.

In the past, Minko  had the role of DevRel, which he also keeps. As product lead, though, one of his new tasks is prioritising the roadmap. So quite a lot of influence.

At the JavaScript Days, he gave an overview of Angular's future. At the moment, a lot of new frameworks come up with huge improvements in terms of hydration. Some people in the Angular community raised concerns that Angular might fall back in that area.

According to Minko, Angular does not ignore these new developments but analyses them and integrates the best parts into the framework.

It was also interesting to hear that Google has been using the concept of "resumability" for almost ten years. In short, "resumability" serialises a closure on the server and continues its execution in the browser. Recently, the framework Qwik made that technique very popular.

{% embed https://www.youtube.com/watch?v=Th4woxrN6bk&t=23226s %}

## ng-conf Videos

ng-conf, one of the biggest Angular conferences, finally published all the recordings for free (if you register). On their platform, you will find a talk on almost any Angular-related topic. 

Very interesting are the talks from the Angular team members themselves. For example, "Angular: A Design Review 10 Years later" by Jeremy Elbourn and Alex Rickabaugh.

{% embed https://twitter.com/ngconf/status/1590739811928711168 %}

## NgRx by Tim Deschryver

NgRx, the most popular Angular library for state management, has been steadily improving by not adding not new features but reducing boilerplate code.

Tim Deschryver, a member of the NgRx team, wrote an article that gives a detailed overview of these changes.

{% embed https://timdeschryver.dev/blog/you-should-take-advantage-of-the-improved-ngrx-apis %}

## New Releases

### Cypress 11

Other than that, Cypress, a testing framework, was released in the new major 11. Its component test runner left the beta status and became stable.

{% embed https://docs.cypress.io/guides/references/changelog#11-0-0 %}

### Jest 29.3

Jest, also a testing library, went up to 29.3 with support for loading WebAssembly in EcmaScript Modules.

[Jest 29.3 Release Notes](https://github.com/facebook/jest/releases/tag/v29.3.0)

### Spectator 12.1 

[Spectator 12.1 Release Notes](https://github.com/ngneat/spectator/blob/master/CHANGELOG.md#1210-2022-11-13)

### PrimeNg 14.2

[PrimeNg 14.2 Release Notes](https://github.com/primefaces/primeng/releases/tag/v14.2.0)
Octoparse Black Friday
Tags: beginners, tooling, saas, webscraping
Published: 2022-11-14 08:40:35

🤩 Octoparse Black Friday
Descuento hasta **40%** solo en **Nov.16**!

[**Estándar Anual**] Ahorrar $271 + 3GB créditos de proxies residenciales+ 240 créditos de resolución de CAPTCHA+ $24 créditos de plantillas + crawler personalizado o la capacitación

[**Profesional Anual**] Ahorrar $800 + 15GB créditos de proxies residenciales + 600 créditos de resolución de CAPTCHA + $60 créditos de plantillas + crawler personalizado o la capacitación de 120min

👉Más detalles: [Sitio web oficial](https://www.octoparse.com/black-friday-2022?utm_source=ytb&utm_medium=social&utm_campaign=22bf)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61qb04799ug41mogga32.jpeg)
3 Top SaaS Companies for Small Businesses in 2023
Tags: saas, blockchain, webdev
Published: 2022-11-14 08:38:41

The right [SaaS billing solution](https://www.leetchi.com/c/subscription-management-software) will allow you to manage all aspects of your subscription billing process in one place. It should also provide you with detailed reports on how well your customers are using your service, so you can improve your marketing efforts.

### SubscriptionFlow

Get a SaaS billing solution that is tailored to your needs instead of going through the difficult billing processes. Eliminate dated procedures for managing LTV, payments, and invoices. Get digital, then!

[SubscriptionFlow](https://www.subscriptionflow.com) is an online retailer with over $100 million in annual revenue. They had been using a legacy system from a previous vendor, which they had grown accustomed to.

This company had been growing rapidly since its inception, and now has more than 100 employees. Their growth required them to hire additional staff to handle customer support requests. However, they found that their current billing system was too slow to keep up with the volume of incoming calls.

### Chargebee

[Chargebee](https://www.chargebee.com) is a large manufacturing firm with over $500 million in annual sales. They had been using an outdated accounting package for years, and their IT department was reluctant to upgrade.

Chargebee also cover small business that needed to track inventory levels and costs. They used Excel spreadsheets to do so, but found that these were difficult to update and maintain.

### SaaSOptics

[SaaSOptics](https://saasoptics.com) started a SaaS business in 1998 that offered solutions for managing marketing resources, but it didn't take us long to realize that our business model didn't work with the conventional tools for doing so.

We used spreadsheets and manual processes because we were unable to find any alternative solutions to [b2b SaaS companies](https://www.thenewsinsides.com/blog/what-is-b2b-saas/), which was only just starting to gain traction.
What are your geek christmas present ideas?
Tags: watercooler
Published: 2022-11-14 07:56:35

With christmas being around the corner for most people, shopping for christmas presents can be a stressful and daunting task. We have the responsibility to find the perfect gift for our loved ones. It's not only about finding something they will like, but also something they will need.

Finding geeky presents is even harder because there is a thin line between things the person could already own and things they wouldn't use at all (owned or not).

What creative ideas do you have for geeky presents this year?

---

_Fun fact: the header image is the first one I created with an AI_
WordPress Header Image Invisible due to Zero Height after Update to 6.1
Tags: webdev, wordpress, css, html
Published: 2022-11-14 07:30:06

After my customer's web hoster updated WordPress from 6.0.2 to [6.1](https://wordpress.org/support/wordpress-version/version-6-1/), the responsive hero header images were not visible anymore. Comparing the HTML source code and CSS styles, we found the problem and the solution.

After I posted the problem on StackOverflow, unsurprisingly, apart from the obvious and correct suggestion to ask it on wordpress.stackexchange.com, instead of answers it attracted downvotes without any further comments, so I realized DEV, as a more helpful and inclusive community, might be a better place to share our insights. 

## "The Problem: Missing Header Images"

Our hero header images were no longer visible in a full-site-editing enabled block theme (originally based on Block Base) as their computed height changed zero pixels.

Changing the style from `height: 100%` to `height: auto` made the images appear again, but only partially.

When comparing the markup, class names, and applied styles, I first failed to see the difference, apart from the fact that `height: 100%` now computes to zero height and the image `position` seems to have changed too. 

## A new Container Class: `is-layout-constrained`

There is a new container class, `.is-layout-constrained` which should not affect the image height as I understood.

## A new `relative` Image Wrapper

As the image has `position: absolute`, this might be due to a change to a parent container. And it is!

Our next positioned parent is the wrapping `<figure>` element `figure.wp-block-post-featured-image` around the actual image. This figure element defaults to `position: relative` in WordPress 6.1, so it serves as a new nearest positioned ancestor (as described in [MDN's Absolute positioning article](https://developer.mozilla.org/en-US/docs/Web/CSS/position#absolute_positioning)).

The following CSS is present only after updating to WordPress 6.1:

```css
.wp-block-post-featured-image {
    /* position: relative; */
}
```

This breaks images set to cover as a hero image like this:

```css
__computed_styles {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
```

A possible solution is to revert the image wrapper to the previous state by explicitly setting the `position` back to `static`. I added both the parent `header` and the actual `figure` element just to make sure to override the default style by giving the new rule a greater [specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) than the original one:

```css
header figure.wp-block-post-featured-image {
  position: static;
}
```
Using Custom Queries in Vue Storefront 2
Tags: javascript, vue, tutorial, programming
Published: 2022-11-14 07:18:59

Vue Storefront uses default GraphQL queries under the hood to fetch and modify the data in a certain e-commerce platform (or any other third party service). This is a very useful feature that can speed up your development but what if you would like to customize it to make it work a bit different?

You can do so by utilizing the concept of Custom Queries. These custom values will replace the default ones to achieve completely new result. If you would like to see this on a real example, I have recorded a video some time ago, where I am showing how to use these Custom Queries in a real Vue Storefront 2 application.

{% youtube 5nCGb-RCkQU %}

Apart from this video, I would highly recommend you to check out following links to learn more about composables and how to extend Vue Storefront 2 application to match your needs best:

* https://docs.vuestorefront.io/v2/composition/composables.html
* https://docs.vuestorefront.io/v2/composition/extending-graphql-queries.html
使用 SQL 產生流水單號
Tags: sql
Published: 2022-11-14 07:00:35

近期開發專案需要使用 SQL 產生西元日期搭配流水號作為單號，例如 P221027001，若當天已經存在第一筆單號，則找到當日最大的單號，將流水號遞增產生下一筆單號，例如 P221027002。

需求很簡單，但考慮到開發的專案是 Web，如果將當日最大單號取出再由後端程式碼產生新單號，當 User 確定存檔後再將單號與資料送至資料庫執行，過程中一來一往，假設當兩個 User 幾乎同時操作時，有極小的機率拿到相同的單號傳回資料庫作業。礙於可能產生重複單號，最後決定當資料送回資料庫時，執行預存再產生新單號，縮小產生新單號與儲存資料之間的時間。

原先預期是由預存程序來執行儲存資料以及產生單號，但在撰寫預存時覺得這樣不太好，該預存命名的定義為儲存資料，裡面竟然偷偷再做產生單號的動作，於是決定將產生單號的動作改為由純量函數執行，下方是**純量函數**預設新增的 Script：

```SQL
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION <Scalar_Function_Name, sysname, FunctionName> 
(
	-- Add the parameters for the function here
	<@Param1, sysname, @p1> <Data_Type_For_Param1, , int>
)
RETURNS <Function_Data_Type, ,int>
AS
BEGIN
	-- Declare the return variable here
	DECLARE <@ResultVar, sysname, @Result> <Function_Data_Type, ,int>

	-- Add the T-SQL statements to compute the return value here
	SELECT <@ResultVar, sysname, @Result> = <@Param1, sysname, @p1>

	-- Return the result of the function
	RETURN <@ResultVar, sysname, @Result>

END
GO
```

在 `BEGIN` 和 `END` 之間加入產生單號的邏輯。

```SQL
DECLARE @RESULT VARCHAR(10) --最終返回的值
DECLARE @MAX AS VARCHAR(10) --從資料表中找到的最大單號
DECLARE @HEADER VARCHAR(8) --扣除流水號的單號頭部

-- 取出當天日期作為單號的一部分: 20221027
SET @HEADER = CONVERT(VARCHAR, GETDATE(), 112)

-- 去除日期前兩碼: 221027
SET @HEADER = SUBSTRING(@HEADER, 3, LEN(@HEADER) - 2)

-- 組裝單號的頭部: P221027
SET @HEADER = 'P' + @HEADER

-- 從資料表欄位取回當天最大單號
SET @MAX = (SELECT MAX(ORDERNO) FROM DBO.ORDERS WHERE ORDERNO LIKE @HEADER + '%')
-- 測試假設存在單號
-- SET @MAX = 'P221027002'
IF @MAX IS NULL -- 如果沒找到 @MAX 會是 NULL
	BEGIN
		-- 當天還沒有單號, 直接將 @HEADER 和流水號組裝: P221027001
		SET @RESULT = @HEADER + '001'
	END
ELSE -- 資料表內已經有當天單號
	BEGIN
		DECLARE @VAL VARCHAR(3)
		
		-- 取最大單號後三位流水號
		SET @VAL = SUBSTRING(@MAX, LEN(@HEADER) + 1, 3)

		-- 轉成 INT 後加一, 再轉回 VARCHAR
		SET @VAL = CONVERT(VARCHAR, CONVERT(INT, @VAL) + 1)

		-- 使用 REPLICATE 函數將流水號前面補零至為三位
		SET @VAL = (REPLICATE('0', 3 - LEN(@VAL)) + @VAL)

		-- 組裝 @HEADER 和流水號: P221027005
		SET @RESULT = @HEADER + @VAL
	END

-- 返回值
RETURN @RESULT
```

完成後，將函數命名為 dbo.fnGetNewOrderNo ，執行函數新增，呼叫函數用 `SELECT <SCHEMA.FUNCTIONNAME>()` 。

```SQL
INSERT INTO [DBO].[ORDERS]
(
	[ORDERNO]
)
OUTPUT inserted.ORDERNO
VALUES
(
	(SELECT dbo.fnGetNewOrderNo()) --呼叫產生單號函數
)
```

利用 `OUTPUT inserted.<column>` 查看指定欄位的執行結果。

![sql-001](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ns7kdcx6hkllcd0fz0fc.png)

如果單號需要西元四碼，例如 20221027，將下面這行移除以及調整 VARCHAR 大小。

```SQL
-- 去除日期前兩碼: 221027
SET @HEADER = SUBSTRING(@HEADER, 3, LEN(@HEADER) - 2)
```

收工！

---

### Reference
[單號產生器](https://www.player.idv.tw/prog/index.php/單號產生器)

---

Thanks for reading the article :tulip: :sunflower: :blossom:

If you like it, please don't hesitate to click heart button :heart:
or follow my [GitHub](https://github.com/FakeStandard) :star:
or buy me a coffee :arrow_down: I'd appreciate it.

[![Buy-me-a-coffee][1]][2]

[1]: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h077sxd0vx1hix4t7lw8.png
[2]: https://www.buymeacoffee.com/FakeStandard

---
Callback in JavaScript
Tags: javascript
Published: 2022-11-14 06:24:18

# Callback

I usually make callback definition this simple: callback is a `function` that passed as a `function argument` (or object property if you using object as function paramter). Later, that function we passed will be executed inside it. Let's take an example.
I simplified `callback` definition for myself

If you still don't get it, may this example could make you understand.

```jsx
const multiply = ({ numb1, numb2 }) => {
	return numb1 * numb2;
};

const sum = ({ numb1, numb2 }) => {
	return numb1 + numb2;
};

const doWith2Numbers = ({ cb, numb1, numb2 }) => {
	return cb({ numb1, numb2 });
}

doWith2Numbers({ cb: multiply, numb1: 2, numb2: 3 }) // 6
doWith2Numbers({ cb: sum, numb1: 2, numb2: 3 }) // 5
```

We have two functions that can multiply and sum of two numbers. So far, you might think, “We can just simply call that function like this.”

```jsx
multiply({ numb1: 2, numb2: 3 })
sum({ numb1: 2, numb2: 3 })
```

It is also a valid syntax but we don’t have blueprints that can reusable later. This simple case: I want to do nothing if `numb2` is 2, 3, or 4.

Instead of editing all functions we have created (`multiply` and `sum`). We can just edit `doWith2Numbers`.

```jsx
const doWith2Numbers = ({ cb, numb1, numb2 }) => {
	const nothingNumbers = [2, 3, 4];
	if (nothingNumbers.includes(num2)) return undefined;
	// other code
}
```

Another example: we are creator of a package but we don’t really know what our package will do. We only know that function receives arguments. We will give the rest to other developer to describe the functionality. We will work with callback often when working with web framework, Express.js.

See you!
AWS Devops Pro your personal tempo.
Published: 2022-11-14 06:23:23

[AWS Devops Pro](https://dumpsarena.com/amazon-dumps/aws-devops-engineer-professional/) Everything withinside the path is both applicable to the examination, or will offer the encompassing understanding for you to assist you bypass with self belief; even as additionally gaining the sensible revel in had to get get entry to to thrilling activity possibilities. Lessons are in no way greater than 20 mins and frequently plenty shorter - I prioritize performance, now no longer period. Each phase consists of a quiz supporting you preserve understanding, and on the give up of the path, we’ve designed a complete exercise examination which mirrors actual-global situations. [AWS Devops Pro](https://dumpsarena.com/amazon-dumps/aws-devops-engineer-professional/) ADVANCED AWS DEVOPS ARCHITECTURE : TBC ALWAYS ACCURATE/ALWAYS UP TO DATE: I pleasure accuracy and so decide to retaining the content material updated with ordinary updates as AWS declares new merchandise or functions. Updates can be protected on your one-time path buy so that you can examine at your personal tempo. By the give up of this path, you may be capable of expectantly bypass the expert-degree AWS Certified DevOps Engineer examination and begin having access to a number of the quality paying careers withinside the enterprise. 

Get 25% Special Discount ……..>>>>>>>>> https://dumpsarena.com/amazon-dumps/aws-devops-engineer-professional/