In vendor\magento\framework\View\Element\Template\File\Validator.php
protected function isPathInDirectories($path, $directories)
{
if (!is_array($directories)) {
$directories = (array)$directories;
}
If you're reading the Magento 2 devdocs for custom attributes, you'll probably notice they give an example of creating a new custom attribute like so:
<?php
namespace Magento\Customer\Setup\Patch\Data;
use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;
const fs = require('fs'); | |
const { once } = require('events'); | |
const readline = require('readline'); | |
const zip = (keys, vals) => | |
keys.reduce((currentObj, prop, idx) => { | |
currentObj[prop] = vals[idx]; | |
return currentObj; | |
}, {}); |
#!/bin/bash | |
# CSV with SOQL example | |
sfdx force:data:soql:query -q "SELECT Name, Username, Email FROM User WHERE IsActive = True" --resultformat csv | paste -sd '\n' >| sf_users.csv | |
# JSON with SOQL Example | |
sfdx force:data:soql:query -q "SELECT Name, Username, Email FROM User WHERE IsActive = True" --resultformat json >> sf_users.json |
node -r dotenv/config index.ts dotenv_config_path=../.env
{ | |
"InvocableMethod": { | |
"prefix": "InvocableMethod", | |
"body": [ | |
"@InvocableMethod(label='$1' description='$2' callout=${3|true,false|} category='$4' configurationEditor='$5')" | |
], | |
"description": "Apex InvocableMethod Annotation, @see https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm" | |
}, | |
"InvocableVariable": { | |
"prefix": "InvocableVar", |
@TestVisible | |
private static Boolean orgIsSandbox { | |
get { | |
if (orgIsSandbox == null) { | |
orgIsSandbox = [SELECT IsSandbox FROM Organization LIMIT 1].IsSandbox; | |
} | |
return orgIsSandbox; | |
} | |
set; | |
} |
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"type": "array", | |
"title": "HubSpot Module", | |
"items": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"description": "The variable name you will use to refer to this field's values, and is what the value of the field is stored against. Cannot contain spaces or special characters.", |
often I get annoying CRLF to LF issues when using an editor that doesn't let you specify default line endings like Obsidian, which is super annoying when syncing notes across devices
so here's a script to use. if you want to filter (e.g. only markdown files) you can pass it as an arg like normalize *[.md]
logger = Logger( | |
service="my-lambda-service", # or any service name | |
utc=True, | |
# Setting formatter_cls doesn't exist directly—pass an instance as below | |
logger_formatter=OtelJsonFormatter(), | |
# log_level="INFO", # optionally set a log level | |
) |