Skip to content

Instantly share code, notes, and snippets.

View kdzwinel's full-sized avatar

Konrad Dzwinel kdzwinel

View GitHub Profile
<head>
...
<meta name="viewport" content="width=device-width">
...
</head>
@kdzwinel
kdzwinel / extension.js
Last active October 25, 2017 17:20
Quick and dirty implementation of runtime type profiling in Visual Studio Code
const vscode = require('vscode');
const path = require('path');
// puppeteer is great because it's easy to use, but it comes with 30MB headless Chrome that
// we can't use as it doesn't have `Profiler.startTypeProfile` yet. We have to point to a
// locally installed Chrome Canary instead. It's fine for a POC, but puppeteer isn't probably
// a good fit in a long run.
const puppeteer = require('puppeteer');
const PATH_TO_CANARY = '/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary';
@kdzwinel
kdzwinel / raf_throttler.js
Created July 7, 2017 08:12
Waiting for IntersectionObserver to get a better support…
function rafThrottler(callback) {
let rafId = null;
const flush = () => {
callback();
rafId = null;
};
return () => {
if (rafId) {
return;
@kdzwinel
kdzwinel / npm-yo.har
Created October 14, 2016 22:38
`yarn add yo` vs `npm i yo` HARs
This file has been truncated, but you can view the full file.
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [],
"entries": [
{