Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active July 6, 2024 14:31
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.
@alejoasotelo
alejoasotelo / search.js
Created February 18, 2021 03:01
get BSC Tokens info from https://bscscan.com
let search = async (name) => {
let response = await fetch('https://bscscan.com/searchHandler?term=' + encodeURIComponent(name) + '&filterby=0');
response = await response.json();
return response
.map((item) => {
item = item.split("\t");
let data = item[2].split("~");
return {
name: item[0],
address: item[1],
@thefuzzy0ne
thefuzzy0ne / AuctioneerReagentSearch.lua
Last active September 27, 2019 20:56
A WowLua script to allow searching for reagents from the trade skills window using Auctioneer
-- Note: Run this only once. If you load it twice, you may have
-- unexpected results. If that does happen, just reload your UI
-- and reload this script, but ONCE this time.
--
---------------------------------------------------------------
-- Instructions for use (After loading the script, of course!):
---------------------------------------------------------------
--
-- Step 1: Open The auction window and any professions window and
-- navigate to a spell.
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active July 6, 2024 17:18
Conventional Commits Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@DmitriyBaklikov
DmitriyBaklikov / labels_guide_github.md
Last active September 8, 2023 09:04
Github Labels Guide

Github Labels Guide

1 Guide Assumptions

This guide is created to make work with labels on Github more constructive and understandable both to development and management parts of the team.

@Zirak
Zirak / gist:3086939
Last active August 27, 2022 22:01
xhr for dummies

So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.

You get a hold on such a prime beast like this:

@zanshin
zanshin / .zshrc
Created August 12, 2011 19:09
My .zshrc file
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="zanshin"