Skip to content

Instantly share code, notes, and snippets.

View arbaouimehdi's full-sized avatar
🎯
focusing

Arbaoui Mehdi arbaouimehdi

🎯
focusing
View GitHub Profile
@arbaouimehdi
arbaouimehdi / settings.json
Last active October 1, 2024 11:16
My Video recording VSCode settings setup
{
"stylelint.enable": false,
"css.validate": false,
"scss.validate": false,
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "never"
},
"workbench.statusBar.visible": false,
"workbench.editor.showTabs": "none",
"workbench.activityBar.location": "hidden",
@arbaouimehdi
arbaouimehdi / container.css
Created September 25, 2024 14:59
Using the `@container` CSS at-rule to conditionally switch emojis based on container height for responsive content.
.container {
/* Enable element size computation */
container-type: size;
container-name: container;
}
.content::after {
/* Default content */
content: "📘";
}

Setup Visual Studio Code Live Server to Use HTTPS

How to setup Live Server extension for Visual Studio Code to use HTTPS with your own SSL certificate without Chrome complaining about an untrusted certificate or insecure origin.

✅ Chrome 115.0.5790.75

✅ macOS Monterey 12.6.7

Warning

Make sure Chrome is not already running.

@arbaouimehdi
arbaouimehdi / measure-operation-duration.js
Created March 17, 2024 14:48
Measures the duration of a 2-second simulated operation after page `load` using `performance.now()`
// Function to simulate
// a long-running operation
function longRunningOperation() {
// Simulate a 2-second operation
return new Promise((resolve) => {
setTimeout(() => {
console.log(
"Operation completed"
);
resolve();
@arbaouimehdi
arbaouimehdi / vscode-link-replacement-using-regex.md
Last active January 7, 2024 20:23
Link Replacement with Regex in VS Code
@arbaouimehdi
arbaouimehdi / vscode-regex-href-replace.html
Created December 1, 2023 20:59
VSCode RegEx `href` Replace
Regex: href="[^"]*"
@arbaouimehdi
arbaouimehdi / vscode-regex-html-comment-removal.html
Created December 1, 2023 20:55
VSCode Regex Comment Removal
RegEx: <!--[\s\S]*?-->
@arbaouimehdi
arbaouimehdi / video-visbility-handler.js
Created October 31, 2023 19:04
Pauses or Play a video based on the tab's visibility status
/**
* Determines the browser-specific properties
* for detecting document visibility changes.
*/
function getVisibilityProperties() {
const mappings = {
hidden: "visibilitychange",
msHidden: "msvisibilitychange",
webkitHidden: "webkitvisibilitychange",
};
@arbaouimehdi
arbaouimehdi / demo.html
Created October 26, 2023 10:34
List.js Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<link rel="stylesheet" href="draft.css" />
<title>Demo</title>
@DATABASE@__%Y-%m-%d_%H-%M-%S