Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active May 8, 2024 22:50
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.
@talon
talon / README.md
Last active June 11, 2021 10:35
Install Docker On Windows 10 Home

Install Docker On Windows 10 Home

"Windows Home Docker Desktop requires Windows 10 Pro or Enterprise version 15063 to run." So says the Docker Installer however, the Docker forums beg to differ

The workaround is to manually image the Hyper-V and Containers features, then trick the installer into thinking you're using Windows Pro.

TL;DR

  1. clone this gist somewhere locally git clone https://gist.github.com/4191def376c9fecae78815454bfe661c.git windows_home_docker
  2. Run windows_home_containers.ps1 in an Administrative Powershell
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active May 10, 2024 14:19
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mastef
mastef / isexist_vs_isnotexist.go
Created February 4, 2016 08:30
os.IsExist(err) vs os.IsNotExist(err)
/*
Watch out, os.IsExist(err) != !os.IsNotExist(err)
They are error checkers, so use them only when err != nil, and you want to handle
specific errors in a different way!
Their main purpose is to wrap around OS error messages for you, so you don't have to test
for Windows/Unix/Mobile/other OS error messages for "file exists/directory exists" and
"file does not exist/directory does not exist"
@killercup
killercup / min-max.rs
Created September 30, 2015 12:02 — forked from anonymous/playground.rs
Rust min! and max! macros
macro_rules! max {
($x:expr) => ( $x );
($x:expr, $($xs:expr),+) => {
{
use std::cmp::max;
max($x, max!( $($xs),+ ))
}
};
}
@anvaka
anvaka / 00.Intro.md
Last active May 5, 2024 12:24
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
---
title: "Xtable examples"
subtitle: "From [this thread](http://stackoverflow.com/questions/32005471/simple-example-of-using-tables-knitr-for-latex)"
author: "Matthew Upson"
date: "15 August 2015"
output: pdf_document
---
```{r}
library("xtable")
@defunctzombie
defunctzombie / browser.md
Last active April 10, 2024 17:45
browser field spec for package.json