Skip to content

Instantly share code, notes, and snippets.

View 4lm's full-sized avatar

Alexis Michaltsis 4lm

View GitHub Profile
@4lm
4lm / define-component.js
Created March 28, 2024 15:27 — forked from monokee/define-component.js
Tiny customElement wrapper that enables scalable web component architecture. Define custom elements with a configuration object that separates markup from css and javascript. Uses a slotted light DOM (no shadow DOM) to allow for powerful component extension, composition and easier styling with external stylesheets and global css variables. Expor…
/**
* Tiny customElement wrapper that enables scalable web component architecture.
* Define custom elements with a configuration object that separates markup from css and javascript.
* Uses a slotted light DOM (no shadow DOM) to allow for powerful component extension,
* composition and easier styling with external stylesheets and global css variables.
* Exports a component class that can be imported and explicitly used to be picked up by module bundlers.
* See comments for examples and GNU license below.
*/
export function defineComponent(name, config) {
@4lm
4lm / gist:7c9b8688136be9c44b36c8a6c7a90d91
Created October 23, 2019 13:52
DRAFT: METADATA_v1_3_SCHEMA and METADATA_v1_4_SCHEMA
"""
JSON schemas used to validate the OEP metadata input as json file.
Usage:
import jsonschema
jsonschema.validate(metadata_json, METADATA_v1_3_SCHEMA)
jsonschema.validate(metadata_json, METADATA_v1_4_SCHEMA)
"""
@4lm
4lm / gist:119efe56631ddfb56408b9864d26226e
Created October 23, 2019 10:33
Screenshot of metadata edit view
in the comments
@4lm
4lm / gist:9b76ea736c9cf2d9440c4122bed7cc2b
Created October 7, 2019 11:59
Errors, running: manage.py test --no-input
- Running: $ python manage.py test --no-input
- Gives errors:
Creating test database for alias 'default'...
/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField TableRevision.date received a naive datetime (2019-10-07 13:56:50.976353) while time zone support is active.
RuntimeWarning)
/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField TableRevision.date received a naive datetime (2019-10-07 13:56:51.002412) while time zone support is active.
RuntimeWarning)
System check identified no issues (0 silenced).
- Running: $ DJANGO_SETTINGS_MODULE="oeplatform.settings" python -m pytest
- Results in:
============================================================================== test session starts ==============================================================================
platform linux -- Python 3.7.0, pytest-3.8.0, py-1.6.0, pluggy-0.7.1
rootdir: /home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform, inifile:
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2
collected 0 items / 6 errors