Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SferaDev
SferaDev / LOAD_DATA.xml
Last active February 2, 2022 14:55
xMART4 Pipelines to create data/models/pipelines from external URLs
<XmartPipeline>
<Context>
<Inputs>
<Add Key="url" Type="text" />
<Add Key="table" Type="text" />
</Inputs>
</Context>
<Extract>
<GetWebService Url="${url}">
<GetJson OutputTableName="data">
@SferaDev
SferaDev / README.md
Last active November 30, 2021 15:09
Create a mp4 file from a Audacity timings file in Powershell

Create a mp4 file from a Audacity timings file

How to use

.\join-by-timings.ps1 '.\input.mp4' '.\timings.txt'
@SferaDev
SferaDev / package.json
Last active September 10, 2021 20:17
DHIS2 Package Validator script
{
"name": "dhis2-package-validator",
"version": "0.0.1",
"bin": "./index.js",
"dependencies": {
"typescript": "4.3.5",
"ncc": "0.3.6",
"cmd-ts": "0.7.0",
"lodash": "4.17.21",
"@eyeseetea/d2-api": "1.9.2"
[
"jE9ljMkiIx1",
"RYizsTNZAVO",
"KRNLnijmvKb",
"vDM8XmmHuft",
"kfQUtLIkaO7",
"x5SBM4Rz2VE",
"qGX0Y51btfg",
"n4ZMmhveIfY",
"en4GrNP03s4",
<div id="app" class="content"><button class="MuiButtonBase-root MuiFab-root makeStyles-fab-16 MuiFab-extended MuiFab-primary" tabindex="0" type="button"><span class="MuiFab-label">Tutorial</span><span class="MuiTouchRipple-root"></span></button><div class="MuiPaper-root react-draggable react-draggable-dragged MuiPaper-elevation1 MuiPaper-rounded" style="width: 300px; transform: translate(720px, 220px);"><div class="MuiDialogTitle-root" id="draggable-dialog-title" style="cursor: move;"><h2 class="MuiTypography-root MuiTypography-h6">Tutorial</h2></div><div class="MuiDialogActions-root MuiDialogActions-spacing"><button class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary" tabindex="0" type="button"><span class="MuiButton-label">Close</span><span class="MuiTouchRipple-root"></span></button></div></div></div>

📌 References

@SferaDev
SferaDev / TestWrapper.md
Last active January 6, 2020 10:13
Wrapper component that auto-generates the ``data-test`` ids for its children

📝 Implementation

  • Target functional components only (we're using them by default now and it keeps things simple)
  • Wrap them recursively down the tree around a TestWrapper
  • The TestWrapper generates a data-test id based on: ComponentName, Namespace, Parents, id, title. name and key.
  • To be deterministic if there're multiple components with the same data-test candidate, it appends a count starting on 2.
  • If the original component defined it's own data-test, the original one is used instead of the candidate.
  • The namespace (defaults to undefined) and attribute name (defaults to data-test) can be customized.

🎨 Screenshots

@SferaDev
SferaDev / generator.ts
Last active September 8, 2019 18:12
DHIS2 Schemas TS definitions generator
import axios from "axios";
import _ from "lodash";
import prettier from "prettier";
import fs from "fs";
interface SchemaProperty {
fieldName: string;
propertyType: string;
constants?: string[];
itemKlass?: string;
@SferaDev
SferaDev / webpackDevServer.config.js
Created August 7, 2019 08:17
Dev Server for d2-ui-components local hot reload
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';