Skip to content

Instantly share code, notes, and snippets.

View abdellatifLabr's full-sized avatar
💪
Improving

Abdellatif Labreche abdellatifLabr

💪
Improving
View GitHub Profile
#! /bin/sh
get_meminfo_value() {
echo $(echo "$1" | grep -w "$2" | tr -s " " | cut -d ' ' -f 2)
}
mem_util() {
local meminfo="$(cat /proc/meminfo)"
local total=$(get_meminfo_value "$meminfo" MemTotal)
local free=$(get_meminfo_value "$meminfo" MemFree)
@abdellatifLabr
abdellatifLabr / broadcast-channel.md
Created November 25, 2023 10:49 — forked from davestewart/broadcast-channel.md
Example of using BroadcastChannel to communicate with pages in the same domain

screenshot