Skip to content

Instantly share code, notes, and snippets.

View stavros-melidoniotis's full-sized avatar
:octocat:

Stavros Melidoniotis stavros-melidoniotis

:octocat:
View GitHub Profile
@stavros-melidoniotis
stavros-melidoniotis / SkeletonImage.tsx
Created June 20, 2023 19:17
NextJS Image component with a skeleton placeholder
import Image, { ImageProps } from "next/image";
import { ReactNode, useState } from "react";
interface ISkeletonImageProps extends ImageProps {
skeleton: ReactNode;
}
const SkeletonImage = ({ skeleton, ...props }: ISkeletonImageProps) => {
const [showSkeleton, setShowSkeleton] = useState<boolean>(true);
const { alt, width, height, src, className } = props;
@stavros-melidoniotis
stavros-melidoniotis / mac-spoofing.sh
Created November 29, 2023 15:36
Change MAC address on macOS.
#!/bin/zsh
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with sudo." >&2
exit 1
fi
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: sudo ./script.sh <interface> <MAC_addr>"
echo "Sets the MAC address for the specified network interface."
echo "Arguments:"