Skip to content

Instantly share code, notes, and snippets.

View AndyDaSilva52's full-sized avatar
🎯
Focusing

Anderson da Silva AndyDaSilva52

🎯
Focusing
View GitHub Profile
@AndyDaSilva52
AndyDaSilva52 / MuleSoft File Filter WinMerge.flt
Last active April 15, 2024 13:38
MuleSoft loose - Suppresses various folder and files related to MuleSoft Project using Anypoint Studio
## This is a directory/file filter template for WinMerge
name: MuleSoft loose
desc: Suppresses various folder and files related to MuleSoft Project using Anypoint Studio
## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include
@AndyDaSilva52
AndyDaSilva52 / RAW(16)_with_DataWeave.md
Last active February 8, 2024 21:53
Oracle Database RAW(16) with DataWeave

ℹ️ This is an interpretation of RAW(16) for the GUID on Oracle Database.

Data Type RAW(16)

SELECT
SELECT
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@AndyDaSilva52
AndyDaSilva52 / fun_transform_XML_Keys_Force_As_Array.dwl
Created November 28, 2023 01:34
DataWeave - Transform XML into JSON forcing Keys to Always return as Array
%dw 2.0
output application/json duplicateKeyAsArray = true
//
var payload = read('<?xml version="1.0" encoding="UTF-8"?><Root><About><Code>29329573000145</Code><Name>COMPANY X</Name><CodeStatus>Ativa</CodeStatus></About><Emails><Email>contact@x.com</Email></Emails><Emails><Email>contact2@x.com</Email></Emails><Phones><AreaCode>19</AreaCode><Phone>34140000</Phone></Phones><Phones><AreaCode>19</AreaCode><Phone>34370005</Phone></Phones><Mobiles><AreaCode>11</AreaCode><Phone>912341234</Phone></Mobiles><Mobiles><AreaCode>11</AreaCode><Phone>956785678</Phone></Mobiles></Root>', 'application/xml')
var root = 'Root'
var arrayKeys = ["Emails", "Phones", "Mobiles"]
var objectKeys = keysOf(payload.'$(root)' as Object) -- (arrayKeys)
---
@AndyDaSilva52
AndyDaSilva52 / fun_rangeDate_filter_holidays_and_weekend.dwl
Created November 28, 2023 01:19
DataWeave - Range of Dates (Array) filtering Holidays, Saturday and Sunday.
%dw 2.0
output application/json
fun isWeekend(d: String | Date) = do {
["1","7"] contains ((d as Date) as String { format: "c"})
}
fun isWeekday(d: String | Date) = do {
not (["1","7"] contains ((d as Date) as String { format: "c"}))
}
{
"settings": {
"enable_new_version_notification": false
},
"rules": [
{
"name": "Anypoint Management Center",
"detection": "STARTS",
"url_fragment": "https://anypoint.mulesoft.com/cloudhub/#/console/applications/cloudhub/",
"tab": {
@AndyDaSilva52
AndyDaSilva52 / Anypoint Design Center - API Design - Title with Project + Branch.js
Created June 24, 2022 00:02
Changes the Title of the Page for the Design Center Project opened.
// ==UserScript==
// @name Anypoint Design Center - API Design - Title with Project/Branch
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Improves the browser window title when using Anypoint Design Center by adding the project name +c branch
// @author AndyDaSilva52
// @match https://anypoint.mulesoft.com/designcenter/designer/
// @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com
// @grant none
// ==/UserScript==
@AndyDaSilva52
AndyDaSilva52 / script.js
Created April 17, 2021 19:54
Chrome SyncedTabs - Export `chrome://history/syncedTabs`
let openTabList = Array.from( document.querySelector("body > history-app").shadowRoot.querySelector('#main-container > #content > #synced-devices').shadowRoot.querySelector('#synced-device-list > history-synced-device-card:nth-child(1)').shadowRoot.querySelector('#history-item-container > #collapse > div#tab-item-list').querySelectorAll('div.item-container') )
.map(e => ` ${e.querySelector('a').getAttribute("href")}`);
copy(openTabList.join('\n'));
@AndyDaSilva52
AndyDaSilva52 / MGTRF.TRF_NCM_Ajustar_NCM_Pai_Sintético.sql
Created April 15, 2021 22:32
#Mega #Tributos - NCM (Nomenclatura Comum do Mercosul) - Ajusta o NCM Pai (Sintético) em todos considerando o Extenso que coincidir mais próximo #MegaERP
declare
v_max_len_ncm_extenso integer;
v_achou_pai CHAR := 'N';
v_pai_ncm_tab_in mgtrf.trf_ncm.ncm_tab_in_codigo%type;
v_pai_ncm_pad_in mgtrf.trf_ncm.ncm_pad_in_codigo%type;
v_pai_ncm_in mgtrf.trf_ncm.ncm_in_codigo%type;
v_pai_ncm_ext mgtrf.trf_ncm.ncm_st_extenso%type;
begin
begin
select max(length(ncm_st_extenso))
@AndyDaSilva52
AndyDaSilva52 / MGCLI.P_CLI_VEN_NF_SEQUENCIA.sql
Last active March 30, 2021 00:15
#Mega - Procedure mostra Sequência de Notas para NFe ou NFSe ou CFe ou NFCe por exemplo que pularam
create or replace PROCEDURE P_CLI_VEN_NF_SEQUENCIA
--(pRC OUT SYS_REFCURSOR) IS
AS
BEGIN
FOR cTDF IN (
SELECT
TD.FIL_IN_CODIGO, TD.SER_ST_CODIGO, TD.TDF_IN_CODIGO, TD.NOT_IN_NUMERO_MIN, TD.NOT_IN_NUMERO_MAX, TD.NOT_IN_NUMERO_MIN_RECENT
FROM (
SELECT S.FIL_IN_CODIGO, S.SER_ST_CODIGO, S.TDF_IN_CODIGO, S.TDF_IN_NDOCINI, S.TDF_IN_NDOCFINAL,