Skip to content

Instantly share code, notes, and snippets.

View jonschlinkert's full-sized avatar
🤔
Trying to stay in the right branch of the wave function.

Jon Schlinkert jonschlinkert

🤔
Trying to stay in the right branch of the wave function.
View GitHub Profile
@bcoe
bcoe / npm-top.md
Last active March 21, 2025 03:49
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

Idiomatic markdown docs

Initially this will be a collection of random tips. My goal is to start recording the things I've learned from maintaining 990+ projects on GitHub and NPM.

Overview

Sections

  • Optional TOC
  • Brief description
@jonschlinkert
jonschlinkert / markdown-toc_repeated-headings.md
Created December 15, 2015 19:42
Example table of contents generated by markdown-toc, correctly links repeated headings.
@apolloclark
apolloclark / postgres cheatsheet.md
Last active May 7, 2025 06:55
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

Keybase proof

I hereby claim:

  • I am tunnckoCore on github.
  • I am tunnckocore (https://keybase.io/tunnckocore) on keybase.
  • I have a public key whose fingerprint is EF84 4C66 A0E5 90FE 8849 452F 8047 B4A8 262C 7486

To claim this, I am signing this object:

@imjasonh
imjasonh / markdown.css
Last active January 3, 2025 20:15
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}

This is why I don't use forEach anymore.

This benchmark was done against native forEach, while, and for. The code for every function follows this pattern:

function code(arr) {
  var res = 0;
  // basic count, just to have it do something
  arr.forEach(function (i) {
 res++;

Easiest Table of Contents possible

In .verb.md where you want to inject the TOC:

<!-- toc -->

Done!

micromatch vs. minimatch (WIP)

Can micromatch be used as a drop-in replacement for minimatch?

For mainstream features, I tried to keep as much parity as possible between micromatch and minimatch. But there are some differences.

Key differences

  • the main minimatch function, minimatch(), works like micromatch.isMatch()
  • the main micromatch function, micromatch(), works like multimatch, with support for multiple patterns.

Regex comparison

In both micromatch and minimatch, globs are converted to regex, which is then used for matching supplied values.

The following example shows one of the implementation differences between micromatch and minimatch, as a way of demonstrating how micromatch manages to have better Bash support while also being 20-120x faster than minimatch.

Pattern

Given this glob pattern: