Skip to content

Instantly share code, notes, and snippets.

View jdalton's full-sized avatar
🫓

John-David Dalton jdalton

🫓
View GitHub Profile
@jkrems
jkrems / es-module-history.md
Last active November 5, 2023 19:35
History of ES modules

Modules - History & Future

History

@ceejbot
ceejbot / esm_in_node_proposal.md
Last active July 17, 2023 02:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

@RReverser
RReverser / acorn-top-level.js
Created March 14, 2017 10:00
Acorn: top-level parsing experiment
// See https://jsperf.com/acorn-top-level-parsing-experiment/1 for example
acorn.plugins.top_level = function (instance) {
// Could skip other things as well, but this
// is where the most time can be saved
instance.parseBlock = function () {
var node = this.startNode();
var length = this.context.length;
do {
this.next();
@chicoxyzzy
chicoxyzzy / nvm-node-nightlies.md
Last active February 6, 2024 16:44
Installing Node Nightlies via nvm

You can install Node Nightlies/RCs via nvm using NVM_NODEJS_ORG_MIRROR environment variable.

Install latest Node RC

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm i node

Install latest Node.js Nightly

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm i node
var browserslist = require('browserslist');
var request = require('sync-request');
var res = request('GET', 'https://saucelabs.com/rest/v1/info/browsers/webdriver');
function lookup(requestedBrowsers, cb) {
var result = {};
var sauce = JSON.parse(res.getBody().toString())
//console.log(sauce);
@michaelficarra
michaelficarra / append-template-tag.js
Created May 30, 2016 14:29
chainable template tag for joining a bunch of strings over many lines
function append(separator) {
return typeof separator === "string" ? appender(separator, "") : appender("", "").apply(this, arguments);
}
function appender(separator, s) {
return function tag(literalParts, ...computedParts) {
s += literalParts[0];
for (let i = 1; i < literalParts.length; ++i) {
s += computedParts[i - 1] + literalParts[i];
}
> eshost host --list
┌──────────────┬─────────┬────────────────────────────────────────────────────┬─────────┐
│ name │ type │ path │ args │
├──────────────┼─────────┼────────────────────────────────────────────────────┼─────────┤
│ chakra │ ch │ C:\Users\brterlso\projects\runify\hosts\ch.exe │ │
├──────────────┼─────────┼────────────────────────────────────────────────────┼─────────┤
│ node │ node │ c:\Program Files\nodejs\node.exe │ │
├──────────────┼─────────┼────────────────────────────────────────────────────┼─────────┤
│ spidermonkey │ jsshell │ C:\Users\brterlso\projects\runify\hosts\js.exe │ │
├──────────────┼─────────┼────────────────────────────────────────────────────┼─────────┤
@bcoe
bcoe / npm-top.md
Last active March 23, 2024 20:02
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@deathbearbrown
deathbearbrown / accessibility.md
Last active April 27, 2017 20:33
Please be accessible, my dudes.

If you have images and you are showing them on the web using an <img> tag, you must ALWAYS include alt text.

If you are writing markdown, you have no excuse not to add alt text.

![Alt text right here buddy](src)

Doing this is lazy. You're better than that.

![](src)
(function () {
var textarea;
function createTextArea() {
if (textarea) {
return textarea;
}
textarea = document.createElement('textarea');
textarea.style.position = 'absolute';
textarea.style.left = '-9999px';
textarea.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';