Ruby Tips from Educative.io

### Ruby Tips from EducativeIO
* `max_by` enum 
  * returns the max value of a string in an array
  * `['ab','abc','abcd'].max_by{|w| w.length} # => 'abcd'`

* `rpad` and `lpad` which adds padding to a string left side or rightside
  * `'hi'.rpad(5, '0') # => 'hi000` 

Express JS

**Express** es un **framework de Nodejs** usado para crear aplicaciones de servidor usando Javascript.

common IG QA issues

/*cookies padding*/
.block--cookies-ui .block__content{
  padding: 0;
}

/* Solutions block */
#block-ascend-ig-products .grid-margin-x:first-of-type {
  margin-left: 0;
  margin-right: 0;
}

/* Whitepaper link */
.page--compliance--ig-wealth .ascend-ig-white-paper a:hover{
  color: #569ee2;
}

/* Footer padding */
.iiroc-disclaimer{
  padding-right: 1.071rem;
  padding-left: 1.071rem;  
}
/* footer icons */
.page--compliance--ig-wealth footer .icon-links .cell .embedded-entity{
  margin-left: a

userScriptBetas

userScriptBetas
// ==UserScript==
// @name        image download beta
// @namespace   Violentmonkey Scripts
// @match       https://bunkr.ru/*
// @grant       none
// @require     https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js
// @require     https://cdnjs.cloudflare.com/ajax/libs/jszip-utils/0.1.0/jszip-utils.min.js
// @require     https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js
// @require     https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js
// @require   

Create & Delete 100 Test User Accounts in a Test Safe for CyberArk PAM

Create & Delete 100 Test User Accounts in a Test Safe for CyberArk PAM
# Import PowerShell module psPAS, if it doesn't exist, install it
Import-Module psPAS -ErrorAction SilentlyContinue
if ($LASTEXITCODE -ne 0) {
    Install-Module psPAS -Force
    Import-Module psPAS
}

$baseURL = Read-Host "Enter the base URL of your CyberArk instance"
$authType = Read-Host "Enter the authentication type (CyberArk, LDAP)"
$credential = Get-Credential

# Connect to CyberArk
New-PASSession -BaseURI $baseURL -Credential $credential -type $authType -concurrentSession $true -ErrorAct

Ingest CSV & Save to Delta-Table

* Ingests CSV files from a folder structure in datalake with some specialties (more than one header row, carriage returns in text fields, ...). * Trims all string columns. * Saves the result to a delta table (overwrite). * Runs as part of a pipeline in a Synapse Notebook.
{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "### Update Budget Data"
      ],
      "metadata": {
        "nteract": {
          "transient": {
            "deleting": false
          }
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from pyspark.sql.types import *\r\n",
        "from pyspark.sql.functions import trim\r\n",
        "from pyspark.sql.functions import col\r\n",
        "\r\n",
        "csv_schema = StructType([

orderBy

todatasubset(
 local!funzionalita,
 a!pagingInfo(
 startIndex: 1,
 batchSize: -1,
 sort: a!sortInfo(
 field: "order",
 ascending: true()
)
)
).data

SQL Server - RAISERROR Como alternativa ao PRINT

[PRINT vs. RAISERROR](https://sqlity.net/en/984/print-vs-raiserror/#:~:text=While%20RAISERROR%20is%20not%20as,the%20currently%20executing%20SQL%20batch.)


Uma das maiores desvantagens do PRINT é o seu comportamento de buffer de saída

Em sua forma padrão, RAISERROR mostra o mesmo comportamento de buffer. 
No entanto, há uma opção pouco conhecida NOWAIT que faz com que o buffer de saída seja liberado imediatamente. 
Isso o torna utilizável para feedback em tempo real:

A desvantagem de usar o RA

Eseguire azioni dopo aver cliccato sulla cella

extension NotificationsAdapter: UITableViewDataSource {
//scrivere questa riga 
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    self.delegateNotification?.notifyTapped(item: items[indexPath.row])
  }
}

Codice sincrono asincrono chiamate api

protocol NotificationsViewModelDelegate: AnyObject {
  func onLoadNotification()
  func onError()
}

test2

Saved from https://conda.io/projects/conda/en/stable/user-guide/install/linux.html#install-linux-silent
Installing on Linux
Download the installer:

Miniconda installer for Linux.

Anaconda installer for Linux.

Verify your installer hashes.

In your terminal window, run:

Miniconda:

bash Miniconda3-latest-Linux-x86_64.sh
Anaconda:

bash Anaconda-latest-Linux-x86_64.sh
Follow the prompts on the installer screens.

If you are unsure about any setting, accept the defaults. You can change them later.

To make the changes take effect, close and then re-open your terminal window.

Test your installat

タクソノミー(カテゴリー)の一覧HTMLを表示する

//▼HTML出力のメリット
//taxonomy.phpなどのテンプレート表示の際に
//表示しているタクソノミのliに「current-cat」クラスが付与されるので、css当てて強調表示できる

<?php wp_list_categories( 'taxonomy=xxx&title_li='); ?> //xxxにタクソノミー名を入力


<!--出力されるHTML-->
<li class="cat-item cat-item-7 current-cat"><a href="http://safetybell.local/news/category/xxx_term1/">ターム1</a></li>
<li class="cat-item cat-item-8"><a href="http://safetybell.local/news/category/xxx_term1/">ターム2</a></li>
<li class="cat-item cat-item-9"><a href="http://safetybell.local/news/category/xxx_te

Find Duplicates on User input via Client Script

created by dev3 on 31-1-2023 in ZCB This client script function concatinate 2 fields and match with module entries to find duplicates.
propname = ZDK.Page.getForm().getValues().Name
cityName = ZDK.Page.getForm().getValues().City
if (propname != null && cityName != null)
{
    uniqName = propname + ' - ' + cityName;
    console.log(uniqName);
    var uniqUpdate = ZDK.Page.getField('Unique_Identifier').setValue(uniqName);
// Search Unique name in Properties module
    var prop = ZDK.Apps.CRM.Properties.searchByCriteria("(Unique_Identifier:equals:" + uniqName + ")");
    console.log(prop);
console.log(prop.length);
    

get raw value from form

this.voucherCampaignForm.getRawValue()

Gestione dei Boolean

if hasSubscription {
  viewConfigurato.isHidden = false
  viewNonConfigurato.isHidden = true
} else {
  viewConfigurato.isHidden = true
  viewNonConfigurato.isHidden = false
}

//può essere riscritto come ->

viewConfigurato.isHidden = !hasSubscription
viewNonConfigurato.isHidden = hasSubscription

index RT

first way - index(local!allUsers, recordType!yourRecordName.fields.yourField, {})
second way - local!allUsers[recordType!yourRecordName.fields.yourField]