Skip to content

Instantly share code, notes, and snippets.

View dustytrinkets's full-sized avatar
🍄

Laura Corbi Villalba dustytrinkets

🍄
  • Madrid
View GitHub Profile
@dustytrinkets
dustytrinkets / escapeStrings.js
Last active October 4, 2022 09:08
recursively iterate through object and escape strings for XML
const escapeSting = (unsafe) => {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&apos;");
}
@dustytrinkets
dustytrinkets / translations-v1.js
Last active June 7, 2020 22:08
translations-v1
{
"id" : "1eb9f956-45b5-41a2-9c2b-b2ea5c761abb",
"published" : false,
"timestamp" : "2020-06-03T13:44:14.714Z",
"content" : [...],
},
{
"id" : "1eb9f956-45b5-41a2-9c2b-b2ea5c761abb",
"published" : true,
"timestamp" : "2020-06-03T14:44:14.714Z",
@dustytrinkets
dustytrinkets / time-indexes.csv
Last active June 15, 2020 15:46
Time for indexes
index:none index:id index:timestamp index:packageId
REIMPORT 3.7 min 5.04 min 3.7 min 5.89 min
REINDEX 2.1 min 2 min 1.75 min 2 min
{
"id" : "2000fc91-0b8a-48a0-0000-dac9fca625b3_id-c6192734-530d-434a-0000-efd74a96a5eb",
"packageId" : "edify-alex.acc-liber.44661866-0000-4b4d-a58b-6d8335b578e0.1.2",
"contentType" : "particle",
"events" : [
{
"timestamp" : "2020-03-30T15:22:57.614Z",
"checksum" : "2f0c5b4bbef45f66cd7208c80aa97203",
"eventType" : "CREATED",
"payload" : {...}
@dustytrinkets
dustytrinkets / translations-v2.js
Last active June 7, 2020 22:09
translations-v2
{
"id" : "1eb9f956-45b5-41a2-9c2b-b2ea5c761abb",
"published" : false,
"timestamp" : "2020-06-03T13:44:14.714Z",
"content" : [...],
},
{
"id" : "1eb9f956-45b5-41a2-9c2b-b2ea5c761abb",
"published" : true,
"timestamp" : "2020-06-03T14:44:14.714Z",
@dustytrinkets
dustytrinkets / particle-v3.json
Last active July 18, 2020 11:38
particle-v3
{
"id" : "1eb9f956-45b5-41a2-9c2b-b2ea5c761abb",
"published" : true,
"timestamp" : "2020-06-03T13:44:14.714Z",
"translationPath" : "bookId/translations/2020-06-03T13:44:14.714Z.json",
"xmlPath" : "bookId/2020-06-03T13:44:14.714Z.xml",
}
@dustytrinkets
dustytrinkets / particle-v1.2.json
Last active June 7, 2020 19:20
particle-v1.2
{
"id" : "2000fc91-0b8a-48a0-0000-dac9fca625b3_id-c6192734-530d-434a-0000-efd74a96a5eb",
"packageId" : "edify-alex.acc-liber.44661866-0000-4b4d-a58b-6d8335b578e0.1.2",
"lastImport" : {
"timestamp" : "2020-04-30T15:28:53.156Z",
"eventType" : "DELETED"
},
"contentType" : "particle",
"events" : [
{
{
"id" : "4bafb92b-e4e0-45c5-a883-a68288ad7e51_id-02847368-5cdc-4c36-8cc1-d519486f2d9f",
"packageId" : "edify-alex.prd-liber.bbd9899b-fbf4-48c9-9b96-e14cbcef610f.1.0",
"contentType" : "particle",
"timestamp" : "2020-05-02T04:00:10.423Z",
"checksum" : "9edc160253341eb92e7a5d9458e27d09",
"eventType" : "CREATED",
"payload" : {...}
}
@dustytrinkets
dustytrinkets / docker-compose.yml
Created February 27, 2020 22:23
docker compose to run
version: "3"
azurite:
image: "arafato/azurite:2.6.5"
container_name: "azurite_storage_emulator"
ports:
- "10000:10000"
@dustytrinkets
dustytrinkets / index.js
Created February 9, 2020 10:05
index.js for docker-node-example
require('dotenv').config();
const express = require('express');
const app = express();
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`Example app listening on port ${port}!`))
app.get('/', (req, res) => res.send(`Your application is running on port ${port}`))