Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Go hard

Den Ilin followdarko

😎
Go hard
View GitHub Profile
View Funcs -> Stack Machine
// Functions:
function a(x, y, z) {
x[y] = z;
}
function b(x, p) {
for (let i in p) a(x, i, p[i]);
}
function c() {
let x = { foo: 'bar' };
View WebDevicePerformance
// https://browser.primatelabs.com/ios-benchmarks
// https://mydevice.io/devices/
// http://vizdevices.yesviz.com/devices.php
const IPHONE5_SIZE = 568
const IPAD_SIZE = 1024
const MIN_OPS = 165 /* Upper limit cpu for iPad4 */
const CACHE_KEY = 'anim'
View console.save()
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
@followdarko
followdarko / Measure CSS recalculations
Created Mar 13, 2017
Paste it into your Chrome DevTools console
View Measure CSS recalculations
function fillStyles(el, sel, styles, type){
el[sel] = el[sel] || {}
for (var key in styles) {
if (!isNaN(key)) {
if (el[sel][styles[key]]) {
let selector
if (type === 'id') selector = '#'+sel
else if (type === 'class') selector = '.'+sel
else selector = '<'+sel+'>'
return {