Skip to content

Instantly share code, notes, and snippets.

View telbiyski's full-sized avatar

Petar Telbiyski telbiyski

View GitHub Profile
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@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
<!DOCTYPE html>
<html>
<body>
<style style="text/css">
.marquee {
height: 50px;
width: 200px;
overflow: hidden;
position: relative;
@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 */