This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt update | |
apt full-upgrade -y | |
apt autoremove -y | |
apt clean | |
journalctl --vacuum-time=3d | |
rm -rf /var/log/apt/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add Docker's official GPG key | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
# Add the repository to Apt sources | |
echo \ | |
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function setImage(input) { | |
const image = document.querySelector(".profile-img") | |
const reader = new FileReader(); | |
reader.onload = (e) => image.src = e.target.result | |
reader.readAsDataURL(input.files[0]); // Read file as data URL | |
} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect } from 'react'; | |
export function useMediaQuery(query, defaultState = false) { | |
const [matches, setMatches] = useState(() => { | |
if (typeof window !== 'undefined') { | |
return window.matchMedia(query).matches; | |
} | |
return defaultState; // SSR safe default | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from pytz import country_timezones, timezone, country_names | |
from pytz.tzinfo import BaseTzInfo | |
from functools import cached_property | |
class Country: | |
def __init__(self, country_code: str): | |
self.country_code = country_code | |
@cached_property |