Postgres estimate count rows

CREATE FUNCTION INSERT-YOUR-SCHEMA-NAME-HERE.count_estimate(query text) RETURNS integer AS $$
DECLARE
  rec   record;
  rows  integer;
BEGIN
  FOR rec IN EXECUTE 'EXPLAIN ' || query LOOP
    rows := substring(rec."QUERY PLAN" FROM ' rows=([[:digit:]]+)');
    EXIT WHEN rows IS NOT NULL;
  END LOOP;
  RETURN rows;
END;
$$ LANGUAGE plpgsql VOLATILE STRICT;

-- how to get estimation
select count_estimate('select 1 from YOUR-TABLE-NAME');

Grunt Using

Go to **M2** store root
1. Add theme to `dev/tools/grunt/configs/local-themes.js`
2. In terminal run:
    ```
    grunt exec:[your_theme]
    grunt less:[your_theme]
    ```
    or
    ```
    grunt watch:[your_theme]
    ```

Метода массивов класс Arrays

# Метод Arrays.toString()
Создан для пребразования в строки только одномерных массивов.
String str = Arrays.toString(имя);
- Примеры:
- int[] array = {1, 2, 3};
- String str = Arrays.toString(array); - _Переменная str будет содержать строковое значение:
"[1, 2, 3]"_

# Метод Arrays.deepToString()
Создан для пребразования в строки двумерных массивов и более.
- String str = Arrays.deepToString(имя);
- int[][] array = { {1, 1}, {2, 2}, {3, 3} };
- String str = Arrays.deepToString(array); -_Переменн

Add update LEad Tracking WF

saleId = sale.get("Sales_Orders.ID");
getSale = zoho.crm.getRecordById("Sales_Orders",saleId);
contct = getSale.get("Contact_Name");
if(contct != null)
{
	contId = contct.get("id");
}
quote = getSale.get("Quote_Name");
info "QUote Details : " + quote;
if(quote != null)
{
	quoteId = quote.get("id");
	getQuote = zoho.crm.getRecordById("Quotes",quoteId);
	quoteInitialTime = getQuote.get("Initial_Meeting_Time");
	quoteCreateTime = getQuote.get("Created_Time");
	info "Quote Created Tim

Remove all files in a directory older than a month

```
find . -type f -mtime +30 -exec rm {} \;
```

find: the name of the command.

.: the location where find should start searching. . represents the current directory.

-type f: only find files (not directories).

-mtime +30: only consider files that were modified more than 30 days ago.

-exec: execute the following command on each file that matches the criteria.

rm {} \;: delete the file. {} is replaced by the current file name.

playwright: 页面等待指定的console消息

        Page.WaitForConsoleMessageOptions option = new Page.WaitForConsoleMessageOptions();
        option.setPredicate(consoleMessage -> consoleMessage.text().equals("lists_ready"));
        page.waitForConsoleMessage(option, ()->{
            log.info("已经处理好list接口数据");
        });

playwright:发送消息到console

page.evaluate("()=>console.log('lists_ready')");

WooCommerce checkout JS to append message and disable elements

$ = jQuery;
var checkout_form = $( 'form.checkout.woocommerce-checkout' );
var append_notice_to_div = $( 'div#order_review' );
var notice_text = "Checkout may take up to 2 minutes to complete. Please avoid refreshing the page, clicking back, or closing the window until confirmation is received.";

checkout_form.on( 'checkout_place_order', function() {

    if( !$('div#ppwc-submit-notice').length ) {
        alert(notice_text);

        append_notice_to_div.append('<div id="ppwc-submit-

Create AAD B2C New Tenant

1.	Login to portal>
2.	Switch to Default Directory>
3.	Home > + Create a resource > Search for "Azure Active Directory B2C" > Create > Create "Create Azure AD B2C Tenant"
4.	Provide OrgName: Strivehard
Domain Name : strivehard, 
Domain Full Name: strivehard.onmicrosoft.com
Subscription : Select, 
Resource: strivehard_resource_group(New) > Create
5.	Switch to new directory (DP > ... > Switch Directory > Switch)
6.	Create New User > Users Blade > + New User 
7.	User: admin@striverra.onmi

Full-Screen Modal w/ × (Close) Button

Example (Transparent, Fee-Only, Fiduciary “Check Out Our Pricing” CTA): https://massotorrence.us1.advisor.ws/wealth-management
<div class="full-screen-modal">
    <h3>Transparent, Fee-Only, Fiduciary</h3>
    <p><button class="button md-trigger" data-modal="modal-12">Check Out Our Pricing</button></p>
    <div class="md-modal md-effect-12">
        <span class="md-close close">×</span>
        <div class="md-modal-wrapper">
            <div class="md-content">
                <h3 class="mb0">Transparent, Fee-Only, Fiduciary</h3>
                <h4 class="mb1">No commissions. No hidden fees. No proprietary products.</h4

varbinry to image mvc

http://www.binaryintellect.net/articles/e6d71127-1f12-4555-879b-6a859947eafa.aspx

Static access to Shopify metaobjects

{% for my_metaobject in shop.metaobjects["feature"].values %}
  <div>{{ my_metaobject.title }}</div>
{% endfor %}

limit special characters


        {% assign fieldArray = fieldArray | AddToArray:'39917' | AddToArray:'39920' %}
        {% for field in fieldArray %}
            $("[id$='field_{{field}}']").on('input', function () {
                $("[id$='field_{{field}}']").val($("[id$='field_{{field}}']").val().normalize("NFD").replace(/[^\u0000-\u007f]/g, ""))
            });
        {% endfor %}

Log Out Custom Question IDs

let questions = SC.campaign.questions.custom
questions.forEach((question)=>{
	console.group("Custom Question:");
	console.log(`Label: ${question.label}`);
	console.log(`ID: ${question.id}`)
	console.groupEnd();
})

Row level filter in Matrix and Total row

Total Measure = CALCULATE([Your Measure], REMOVEFILTERS())

Row Level Measure = 
IF(
    ISFILTERED(TableOrColumn),
    [Your Measure],
    [Total Measure]
)

Git

ignorer le fichier spécifique localement:
git update-index --skip-worktree chemin/vers/votre/fichier
Si vous souhaitez réactiver le suivi du fichier à l'avenir:
git update-index --no-skip-worktree chemin/vers/votre/fichier