Skip to content

Instantly share code, notes, and snippets.

View KL13NT's full-sized avatar
:shipit:
Making salad and killing bugs

Nabil Tharwat KL13NT

:shipit:
Making salad and killing bugs
View GitHub Profile
module.exports = {
module: {
rules: [
{
test: /\.module\.sass$/i,
use: [
mode === 'development' ?
'style-loader' :
MiniCssExtractPlugin.loader,
@KL13NT
KL13NT / aww.js
Last active October 6, 2023 05:11
A script to transform Animated Webp files into Webm files. Tested on Windows only. Depends on ffmpeg and libwebp. Make sure to add them to your PATH.
/**
* This script transforms animated webp files which are not widely supported yet
* to simple animated webm. Please state the source of your share this.
*
* # How this works
* This script depends on ffmpeg and libwebp provided by Google. Make sure
* they're in your PATH.
*
* The way this works is based off this answer https://askubuntu.com/a/1141049.
* It starts by extracting the input webp frames to a ./frames directory and,
@KL13NT
KL13NT / spotify-dl.bat
Last active January 1, 2022 05:57
Spotify-dl: A NodeJS script to download spotify tracks from youtube. Depends on node-fetch and youtube-dl.
@echo off
SET CLIENT_ID=
SET CLIENT_SECRET=
SET YOUTUBE_KEY=
node PATH\TO\SCRIPT\spotify-dl.js %1
rem %1 track link
rem this file may be added to your env to quickly execute the script anywhere on your pc.
@KL13NT
KL13NT / index.js
Created April 5, 2021 13:40
A simple NodeJS Puppeteer automation script to detect a single change on a webpage. Supports authentication.
/**
* 1. npm init -y
* 2. npm install puppeteer @types/puppeteer env-cmd say
* 3. create .env file with required variables
id_selector=
password_selector=
submit_selector=
id=
password=
login=
@KL13NT
KL13NT / init.bat
Last active December 30, 2021 13:07
A simple NodeJS script to init a git repo with specific gpg credentials and author email for people who have multiple git identities. You need NodeJS and npm to install inquirer first tho.
@echo off
node %~dp0\initrepo.js
@KL13NT
KL13NT / data.json
Created October 31, 2023 17:02
Sample Data
[{
"name": "Sample Product"
}]
@KL13NT
KL13NT / what-forces-layout.md
Created August 7, 2024 10:01 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent