Skip to content

Instantly share code, notes, and snippets.

View scheibome's full-sized avatar

Scheibo scheibome

View GitHub Profile
@scheibome
scheibome / input.scss
Last active October 22, 2021 08:57
Spacing before and after in scss with scss-maps
$spacing-orientation-map: (
'frame-space-before': 'top',
'frame-space-after': 'bottom'
);
$spacing-map: (
'extra-small': '1',
'small': '2'
);
export const initLazyloading = (selector: string): void => {
let images = document.querySelectorAll(selector)
if ('IntersectionObserver' in window) {
// Create new observer object
let lazyImageObserver = new IntersectionObserver(function(entries, observer) {
// Loop through IntersectionObserverEntry objects
entries.forEach(function(entry) {
// Do these if the target intersects with the root
if (entry.isIntersecting) {
@scheibome
scheibome / LanguageMenu.html
Last active January 13, 2023 10:39
Simple language menu in TYPO3
<f:if condition="{menuLanguage}">
<nav class="c-languageselect">
<button class="c-languageselect__button" id="languageselectbutton">
{site.languages.{data.sys_language_uid}.navigationTitle}
<i class="icon icon-expand_more"></i>
</button>
<ul id="languageselect__list" class="c-languageselect__list">
<f:for each="{menuLanguage}" as="item">
<li class="c-languageselect__item">
<f:if condition="{item.active} == 0">
@scheibome
scheibome / question1.scss
Last active June 11, 2019 10:34
How can I write this in #SCSS without writing the >li again? I don't have a clue
// How can I write this in #SCSS without writing the > li for message--error again?
// like .message.message--error > li
.message {
> li {
background-color: green;
}
@mikowl
mikowl / oneliners.js
Last active June 29, 2024 17:39
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
@georgringer
georgringer / Gridelements Configuration
Last active August 7, 2020 09:07
TYPO3 Gridelements, configuration by files without any database involvement
# Page TSConfig:
tx_gridelements.setup {
# Identifier
2col {
title = 2 Spalten
config {
colCount = 2
rowCount = 1
rows {
1 {
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@spoonerWeb
spoonerWeb / HelpfulToolsToConcentrate.md
Last active October 2, 2019 09:16
Helpful tools to concentrate on important things

Helpful tools to concentrate on important things

devdocs.io

It's a bundle of documentation of languages, projects and other stuff. Easily searchable and can be used offline.

Download: https://devdocs.io

postman

@simonhaenisch
simonhaenisch / build-scss.js
Created August 20, 2016 10:36
Build SCSS with the `node-sass` npm module
// npm install node-sass
var fs = require('fs'),
sass = require('node-sass');
// specify in-/output files
var inFile = '/path/to/main.scss',
outFile = '/path/to/main.css';
sass.render(
@scheibome
scheibome / basic.js
Created February 18, 2016 20:00
QZ javascript
(function($) {
'use strict';
/**
* trim functions
*
* @class trim
*/
function Trim() {
/**
* @type {number}