Skip to content

Instantly share code, notes, and snippets.

View elbakerino's full-sized avatar

Michael Becker elbakerino

View GitHub Profile

Inspired by the emojis for release notes, these here are intended to give comments a better reading guidance, especially for documentations and walk-throughs.

Meaning Emoji
check here/next 👉
read more/in-depth 🎵
feature with high potential/hidden gem 💎

...

@elbakerino
elbakerino / semantic-emoji-release.md
Last active September 1, 2022 06:08
semantic-emoji-release
@elbakerino
elbakerino / tabs-group.js
Last active June 21, 2022 10:56
Example JS for the Formanta/Sass tabs component
const calcTabHeight = (tab) => {
// todo: find a better way to get the correct height size of tab + tab content
const tabContentHeight = Array.from(tab.children).reduce((height, child) => {
const styles = window.getComputedStyle(child);
const styleGutter = parseFloat(styles.getPropertyValue('margin-top')) +
parseFloat(styles.getPropertyValue('margin-bottom'));
return height + child.getBoundingClientRect().height + styleGutter;
}, 0);
const styles = window.getComputedStyle(tab);
const styleGutter = parseFloat(styles.getPropertyValue('padding-top')) +
@elbakerino
elbakerino / collapse.js
Last active June 14, 2022 16:31
collapse.js
/*
* Simple vanilla JS height collapsible.
* For HTML with a [data-toggle] and a `.collapse` as next neighbor:,
* License: by github.com/elbakerino 2022, WTFPL https://en.wikipedia.org/wiki/WTFPL
* <ul>
* <li>
* <button data-toggle="on">Toggle 1</button>
* <div class="collapse closed">
* <div>
* <h2>Item 1</h2>
@elbakerino
elbakerino / CustomValidator.js
Last active May 7, 2020 20:43
UI-Schema Custom Validator Scribble
import {NextPluginRenderer} from "@ui-schema/ui-schema/EditorPluginStack";
// this is a normal plugin, as we need to access the hook and this is not possible from wihin validatorPlugins
const CustomValidator = ({errors, valid, ...props}) => {
let {storeKeys} = props;
const {store} = useSchemaStore();
// should the internals store be used/compatible for this, maybe the internals store needs another structure
const errorForWidget = store.getInternals() ? store.getInternals().getIn(storeKeys.push('server-validation')) : null;
if(errorForWidget) {
@elbakerino
elbakerino / op-status.php
Created December 1, 2019 19:13
PHP OpCache Status Script
#!/usr/bin/env php
<?php
/**
* Prints a nice op cache status in the PHP CLI, for that `opcache.enable_cli = 1` must be set in your opcache ini
* Simply run it with: php op-status.php
*
* LICENSE: MIT
*
* @author Michael Becker, https://mlbr.xyz