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 / 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 / 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==
{
"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 / 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"}))
}
@AndyDaSilva52
AndyDaSilva52 / fun_transform_XML_Keys_Force_As_Array.dwl
Last active December 7, 2024 11:19
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>[email protected]</Email></Emails><Emails><Email>[email protected]</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)' default {}) as Object) -- (arrayKeys)
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@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
@AndyDaSilva52
AndyDaSilva52 / MuleSoft_File_Filter_WinMerge.flt
Last active March 20, 2025 21:17
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