Skip to content

Instantly share code, notes, and snippets.

@Naedri
Naedri / styles-checklist-to-css-from.scss
Last active November 24, 2023 08:21
Checklist to know if a SCSS style file can be simplified into CSS.
// 1. File Extension
// - Example: The file is named styles.scss
// 2. SCSS Syntax Features
// - Example: Use of variables, nesting, mixins, and extends in this file.
$base-font-size: 16px;
body {
font-size: $base-font-size;
@Naedri
Naedri / automated-js-testing-frameworks.md
Last active August 24, 2023 22:27
A timeline chart illustrating the history of automated JavaScript testing frameworks and their generations.
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%%

timeline

%%title History of Automated JS Testing Frameworks

section Prerequisites
    1993: Web
    2000-2004: Start of automation with simple test scripts
@Naedri
Naedri / javascript-testing-frameworks-comparison.md
Last active August 29, 2023 14:02
Comparison of Various JavaScript Testing Frameworks and Libraries for UI and Beyond

| Criteria | Comments | WebdriverIO | TheIntern | Nightwatch | TestCafé | Playwright | | -------------------------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------

@Naedri
Naedri / swap.c
Created June 13, 2023 13:40
Exemples simples de fonctions de swap en C et en C++ pour différents types de passage de paramètres
#include <stdio.h>
void swapByCopy(int a, int b) {
int temp = a;
a = b;
b = temp;
}
// Le passage par pointeur pour obtenir un comportement similaire au passage par référence en C++.
// Cela implique de passer l'adresse des variables à une fonction et d'utiliser les pointeurs pour accéder et modifier les valeurs des variables d'origine.
@Naedri
Naedri / 00_from_google_maps_to_geojson_by_osm.sh
Last active May 16, 2023 21:14
To parse places from a google maps list into a .geojson file powered by OSM, with ordered and linked points.
#!/bin/bash
# This script executes the four Python files sequentially to perform a series of tasks.
# Make sure you have Python installed and the necessary dependencies for each Python script.
# pip install -r requirements.txt
# Step 1: Convert maps to JSON
python 01_maps_to_json.py --address_suffix ", Krakow"
# Step 2: Convert JSON to GeoJSON
@Naedri
Naedri / alarm.sh
Last active February 1, 2023 22:49
To retrieve my laptop quickly
#!/bin/bash
# To lock session if needed
# loginctl lock-session
echo && date
echo 'Starting alarm.sh'
SOUND_PERCENT=150
SOUND_FREQUENCY=1000
@Naedri
Naedri / Object_concatenation.js
Last active August 25, 2022 22:03
Objects concatenation with redondant values.
let obj1, obj2, obj3;
/**
* spread_synthax
*/
//with non redondant values, everyone stay
obj1 = { food: 'pizza', car: 'ford' };
obj2 = { animal: 'dog' };
obj3 = { ...obj1, ...obj2 };
console.log(obj3); // => { food: "pizza", car: "ford", animal: "dog" }
@Naedri
Naedri / format.color.ts
Last active August 9, 2022 14:03
Color conversion and tool with RGB & hexadecimal code.
// Working in all environments
// https://stackoverflow.com/a/39077686
/**
* Converting RGB to hex
* @param r red
* @param g green
* @param b blue
* @returns Hexacode color
* @example rgbToHex(0, 51, 255); // '#0033ff'