Skip to content

Instantly share code, notes, and snippets.

View telbiyski's full-sized avatar

Petar Telbiyski telbiyski

View GitHub Profile
@telbiyski
telbiyski / Listen for CSS class change in pure JS - Mutation Observer.md
Created July 9, 2022 20:11
Listen for CSS class change in pure JS - Mutation Observer
@telbiyski
telbiyski / memorySizeOfObject.js
Created January 29, 2020 14:41
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@telbiyski
telbiyski / high-dpi-media.css
Created October 30, 2019 09:32 — forked from marcedwards/high-dpi-media.css
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */