Skip to content

Instantly share code, notes, and snippets.

View DanteDeRuwe's full-sized avatar

Dante De Ruwe DanteDeRuwe

View GitHub Profile
@DanteDeRuwe
DanteDeRuwe / cypress-run-local-parallel.sh
Last active January 30, 2024 08:06
Run cypress tests in parallel locally
########################################################################
# RUNS ALL .cy.ts FILES IN THE cypress/e2e FOLDER IN PARALLEL
# ARGUMENT $1: The path to the directory containing the cypress folder
########################################################################
baseCommand="npm run dev --" # change this if needed
echo ""
# validate argument
@DanteDeRuwe
DanteDeRuwe / video-speed.user.js
Created April 4, 2023 11:20
Video speed user script.
// ==UserScript==
// @name Video speed
// @author Dante De Ruwe
// @version 0.0.7
// @description Let's you change the speed for all HTML5 videos with the use of the square bracket keys.
// @namespace http://tampermonkey.net/
// @include *
// ==/UserScript==
(function () {
@DanteDeRuwe
DanteDeRuwe / lazy.directive.ts
Created June 16, 2022 12:32
Angular automatic lazy loading directive (using loading="lazy" if supported)
import { AfterViewInit, Directive, ElementRef } from '@angular/core';
@Directive({
selector: 'img',
})
export class LazyDirective extends Directive implements AfterViewInit {
constructor(private elementRef: ElementRef<HTMLImageElement>) {
super();
}
@DanteDeRuwe
DanteDeRuwe / enable-logging-in-karma-conf.js
Last active April 28, 2022 14:11
Enable logging in karma.conf.js
browserConsoleLogOptions: {
level: 'log',
format: '%b %T: %m',
terminal: true,
},