Skip to content

Instantly share code, notes, and snippets.


jakub-g jakub-g

  • Antibes, France
  • 14:00 (UTC +02:00)
View GitHub Profile
sindresorhus /
Last active March 27, 2023 06:11
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
jakub-g / resource-timings-console-table.js
Last active July 10, 2019 12:14
A little copy-paste to dump resource timings to console via `console.table()`
View resource-timings-console-table.js
var regex = /playerv5|jquery/ // customize this
function pick(obj, ...entryNames) { let retObj = {}; entryNames.forEach(key => {retObj[key] = obj[key]}); return retObj }
// uncomment interesting items below, keeping in mind console width / no. of columns constraints
.filter(item =>
.map(i => pick(i, 'name', /*'startTime', 'duration',*/ 'initiatorType',
'transferSize', 'encodedBodySize', 'decodedBodySize',
'fetchStart', /*'domainLookupStart','domainLookupEnd', 'connectStart', 'connectEnd', 'secureConnectionStart', 'requestStart', */'responseStart', 'responseEnd',)))
offirgolan / unwatch-gh-org.js
Created August 2, 2017 05:57
Unwatch All Org Repos
View unwatch-gh-org.js
// Navigate to and then run:
// Taken from:
.forEach(el => { const org = el.querySelector('a[href^="/YOUR_ORG"]'); if (org) el.querySelector('button').click()});
danharper /
Last active August 24, 2022 11:25
Open native Maps apps on iOS and Android in Cordova
iOS (with pin, iOS will lookup address too and show that as label)
Android, no pin (just open at location)
staltz /
Last active March 27, 2023 10:17
The introduction to Reactive Programming you've been missing
ndarville /
Last active February 28, 2023 12:37
Business models based on the compiled list at I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models


Models Examples
Display ads Yahoo!
Search ads Google
piscisaureus /
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

yurial / git-rebase--interactive.patch
Created February 25, 2012 16:29
show author on rebase
View git-rebase--interactive.patch
-git rev-list $merges_option --pretty=oneline --abbrev-commit\
+git rev-list $merges_option --pretty=">%h (%an <%ae>) %s"\
1 pick 19f43c1 (Yuri Dyachenko <>) add: gcrypt::noerr
2 pick 990a7e8 (Yuri Dyachenko <>) add: gcrypt::throwif( err ) throw if err != noerr
3 pick cb03f3b (Yuri Dyachenko <>) add: ext::move<T> move semantic