Skip to content

Instantly share code, notes, and snippets.

View mmounirf's full-sized avatar

Mohamed Mounir mmounirf

View GitHub Profile
@mmounirf
mmounirf / webp.sh
Created June 13, 2025 22:29
Convert all images in a given folder to webp
#!/bin/bash
for D in `find . -type d`
do
# cd $D
echo "Entered directory $D"
cd $D
# Define the image types to search for
image_types=("*.jpeg" "*.jpg" "*.tiff" "*.tif" "*.png" "*.webp")
@mmounirf
mmounirf / SearchInput.tsx
Last active June 17, 2024 02:49
Debounced callback
import { type ChangeEventHandler, useState } from 'react'
import { useDebouncedCallback } from './useDebouncedCallback'
type SearchInputProps = {
onChange: (query: string) => void
}
const SearchInput = ({ onChange }: SearchInputProps) => {
const [searchTerm, setSearchTerm] = useState<string>('')
@mmounirf
mmounirf / images-conversion.sh
Last active April 6, 2024 02:14
Bulk images conversation using cwebp
# cd /path/to/images/directory
# check https://developers.google.com/speed/webp/docs/cwebp for cwebp options
`for file in *; do cwebp -lossless 50 "$file" -o "${file%.*}.webp"; done`
@mmounirf
mmounirf / cssToSvgGradient.js
Created November 9, 2023 12:36
CSS to SVG gradient
function cssToSvgGradient(cssGradientValue) {
// Parse the CSS gradient value.
const gradientMatch = cssGradientValue.match(/(?:linear-gradient|radial-gradient|conic-gradient)\((.*?)\)/);
if (!gradientMatch) {
throw new Error('Invalid CSS gradient value: ' + cssGradientValue);
}
const gradientParams = gradientMatch[1].split(',');
const gradientType = gradientMatch[0];
[
{
"shippingDimensions": " 32.26 cm length x 22.81 cm width x 6.71 cm height"
},
{
"shippingDimensions": " 32.99 cm length x 22.00 cm width x 7.21 cm height"
},
{
"shippingDimensions": " 53.34 cm length x 13.34 cm width x 31.75 cm height"
},
This file has been truncated, but you can view the full file.
[
{
"url":"https://www.target.com/p/barbie-travel-doll-puppy-playset/-/A-75569033",
"name":"Barbie Travel Doll & Puppy Playset",
"description":"<h4>Description</h4>Barbie doll can take her puppy, and young dreamers, around the world with this travel-themed set. Inspired by Barbie Dreamhouse Adventures, it comes with so many pieces to help imaginations take off - peek into the everyday life of Barbie as she embarks on exciting adventures with her family and friends! Barbie doll has her puppy as a traveling companion and a pink suitcase that opens and closes - it even has a collapsing handle, just like real luggage! Plus, the travel set includes a sheet of stickers that can be used to decorate the suitcase and document her travels. Fill her suitcase and her pink backpack (already decorated) with travel necessities like a cell phone, eye mask, neck pillow and headphones. Freshen Barbie doll up at arrival with a toothbrush and toothpaste that fit into her makeup bag. Then put on her sunglasse
@mmounirf
mmounirf / master-javascript-interview.md
Created August 27, 2018 08:54 — forked from Geoff-Ford/master-javascript-interview.md
Eric Elliott's Master the JavaScript Interview Series
@mmounirf
mmounirf / frontendDevlopmentBookmarks.md
Created September 16, 2016 03:00 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.