Last active
December 11, 2018 13:51
-
-
Save tassoevan/78b043b43f7fe7f18f7110ba148a5a52 to your computer and use it in GitHub Desktop.
Rocket.Chat utils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rocketchat_test_mode { | |
docker stop rocketchat_mongo | |
docker rm rocketchat_mongo | |
docker run --name=rocketchat_mongo -p 27017:27017 -d mongo:3.2 mongod --smallfiles --oplogSize 128 --storageEngine=mmapv1 | |
TEST_MODE=true MONGO_URL=mongodb://localhost:27017/rocketchat meteor run | |
} | |
#meteor npm run chimp-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const document = window.document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg'); | |
const newSvg = document.documentElement; | |
newSvg.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xlink', 'http://www.w3.org/1999/xlink'); | |
newSvg.setAttribute('style', 'display: none'); | |
Array.from(window.document.querySelector('#icon-add-reaction').parentElement.children) | |
.sort((iconA, iconB) => iconA.getAttribute('id').localeCompare(iconB.getAttribute('id'))) | |
.map((icon) => icon.cloneNode(true)) | |
.map((icon) => Array.from(icon.attributes) | |
.sort((attrA, attrB) => attrA.name.localeCompare(attrB.name)) | |
.reduce((icon, attr) => { | |
icon.removeAttribute(attr.name); | |
icon.setAttribute(attr.name, attr.value); | |
return icon; | |
}, icon) | |
) | |
.forEach((icon) => { | |
newSvg.appendChild(document.createTextNode('\n ')); | |
newSvg.appendChild(icon); | |
}); | |
newSvg.appendChild(document.createTextNode('\n')); | |
console.log(newSvg.outerHTML); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment