Skip to content

Instantly share code, notes, and snippets.

/*
* xlf-to-json-source.js
*
* Convert an Angular XLF (XLIFF) file to a flat JSON file for use with ngx-translate.
* Extracts all <trans-unit> keys and their <source> text as key-value pairs.
*
* Requirements:
* - Node.js (any modern version)
* - jsdom npm package (install with: npm install jsdom)
*
@johnkegd
johnkegd / Accordion.xml
Last active August 29, 2023 09:12 — forked from salomao-santos/aem-component-dialog.md
AEM: Dialog field example: structure of a dialog, checkbox, datepicker, fileupload, multifield, numberfield, pathbrowser, pathfield, radiogroup, richtext, select, textarea, textfield
<accordion jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/accordion">
<items jcr:primaryType="nt:unstructured">
<borders
jcr:primaryType="nt:unstructured"
jcr:title="Borders styles"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<name
jcr:primaryType="nt:unstructured"
@johnkegd
johnkegd / gist:b912d577062a99c5fc7bf0b130c9b6f3
Last active March 31, 2022 11:11
Select2 jquery plugin - adapters and decorators templates. (MultipleSelection, SingleSelection, Search and more)
/**
* Results adapter 0
* Hides options from the dropdown list that contain the hidden attribute.
* It is necessary to load the module after the select2 library and before the xfaWidget.dropDownList
*/
$.fn.select2.amd.define(
"resultsAdapter",
[
"jquery",
"select2/utils",
@johnkegd
johnkegd / throttling-profiles
Last active March 31, 2022 11:11
Network throttling profiles
| Profile | download (kb/s) | upload (kb/s) | latency (ms) |
| -------------- | ----- | ----- | --- |
| Native | 0 | 0 | 0 |
| GPRS | 50 | 20 | 500 |
| 56K Dial-up | 50 | 30 | 120 |
| Mobile EDGE | 240 | 200 | 840 |
| 2G Regular | 250 | 50 | 300 |
| 2G Good | 450 | 150 | 150 |
| 3G Slow | 780 | 330 | 200 |
| 3G Regular | 750 | 250 | 100 |
@johnkegd
johnkegd / upcBase.js
Created August 12, 2021 19:23
Exploring vulnerability from Upc router ConnectBox DCHP admin page login
/**
* Exploring Upc Connect Box admin conection vulnerability
* file: base.js
* line: 1026
* @params:
* {@String loginCSRMode} userData.loginCSRMode = "1"
* {@String UserName} userData.UserName = "upccsr"
*/
function getUserData(userData, callback) {
@johnkegd
johnkegd / UtilsJcrQuery.md
Created August 10, 2021 09:54
AEM utils jcr queries - JcrQuery (SQL2 - XPATH)

Useful queries in aem development, possibility of direct use in crx query tools


SQL2

All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")