Skip to content

Instantly share code, notes, and snippets.

View fgeierst's full-sized avatar

Florian Geierstanger fgeierst

View GitHub Profile
@fgeierst
fgeierst / index.html
Created April 26, 2025 13:04
playground-elements
<link
rel="stylesheet"
href="/node_modules/playground-elements/themes/neo.css"
/>
<script type="module" src="/node_modules/playground-elements/playground-ide.js"
></script>
<playground-ide
id="playground"
resizable
@fgeierst
fgeierst / git-commit-msg.md
Created September 2, 2023 09:02
Semantic Commit Messages
  • feat for a new feature for the user, not a new feature for build script. Such commit will trigger a release bumping a MINOR version.
  • fix for a bug fix for the user, not a fix to a build script. Such commit will trigger a release bumping a PATCH version.
  • perf for performance improvements. Such commit will trigger a release bumping a PATCH version.
  • docs for changes to the documentation.
  • style for formatting changes, missing semicolons, etc.
  • refactor for refactoring production code, e.g. renaming a variable.
  • test for adding missing tests, refactoring tests; no production code change.
  • build for updating build configuration, development tools or other changes irrelevant to the user.

Source: http://karma-runner.github.io/6.4/dev/git-commit-msg.html

a:not([class]) {
/* Relatively sized thickness and offset */
text-decoration-thickness: max(0.08em, 1px);
text-underline-offset: 0.15em;
}
/* https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/ */
@fgeierst
fgeierst / visually-hidden.css
Created May 30, 2023 09:41
Short visually hidden utility
/* Visually hide an element while still making it accessible for screen readers. */
.visually-hidden {
position: absolute;
transform: scale(0);
}
/* https://www.scottohara.me/blog/2023/03/21/visually-hidden-hack.html
* https://codepen.io/scottohara/pen/QWVOqNY
*/
@fgeierst
fgeierst / Main.js
Created July 26, 2022 12:06
Islands architecture with TYPO3+Rollup+Svelte
import Test from './Test.svelte';
// Mount Svelte component
const test = new Test({
target: document.querySelector('#test')
});
@fgeierst
fgeierst / style.css
Last active June 18, 2021 16:46
CSS grid: responsive center container
.wrapper {
display: grid;
grid-template-columns: 1fr minmax(auto, 20em) 1fr;
}
.wrapper > * {
grid-column: 2 / -2;
}
@fgeierst
fgeierst / glyphhanger.bat
Created March 15, 2021 10:55
Convert variable font TTF to woff2, subsetting to LATIN1
glyphhanger --subset=*.ttf --formats=woff2 --LATIN
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
@fgeierst
fgeierst / functions.php
Last active December 27, 2020 14:19
<img> srcset sizes calculation in different wordpress themes
/* https://www.smashingmagazine.com/2015/12/responsive-images-in-wordpress-core/ */
function adjust_image_sizes_attr( $sizes, $size ) {
$sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px';
return $sizes;
}
add_filter( 'wp_calculate_image_sizes', 'adjust_image_sizes_attr', 10 , 2 );
@fgeierst
fgeierst / functions.php
Created December 26, 2020 19:22
Add SVG to allowed file uploads in Wordpress without plugin
/**
* add SVG to allowed file uploads
**/
function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;