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

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++;
@imjasonh
imjasonh / markdown.css
Last active September 3, 2025 22:12
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;
}

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:

@apolloclark
apolloclark / postgres cheatsheet.md
Last active October 31, 2025 06:15
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

@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.

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
@bcoe
bcoe / npm-top.md
Last active November 3, 2025 11:19
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
@jonschlinkert
jonschlinkert / open-iterm-from-finder.md
Last active July 11, 2024 21:42
Add an icon to your finder toolbar to open iTerm in the current folder.

Open iTerm from finder

The code and instructions in this gist are from http://peterdowns.com/posts/open-iterm-finder-service.html. I've had to do this a few times and wanted to distill it the basics.

  1. Open Automator
  2. Create an Application
  3. Choose Actions > Utilities > Run Applescript
  4. Paste the contents of open_in_iterm.app into the window.
  5. Save the script somewhere convenient
  6. Find the script, then drag the script onto the Finder window while holding the command key (or in Yosemite, the command + option keys)

Cheatsheet

Move cursor

command description
ctrl+a Move cursor to the start of the line
ctrl+e Move cursor to the end of the line
or ctrl+b Move cursor back one character
▶ or ctrl+f Move cursor forward one character

Code project conversion funnel

A page-rank-like approach to scoring code libraries for quality and dependability. This is a quick-pass attempt at translating metrics we have readily available in the code community into a conversion funnel that might be familiar to marketers.

Conversion funnel equivalent Metric Description
awareness github stars Equivalent of "likes", but only slightly better than visits (it's possible to have many stars per one visitor). This metric only proves awareness, no causal relationship to actual interest, "real" popularity, code quality, trust, intent to use, or advancement in the conversion funnel.
interest dependents Dependants are a sign of awareness and commitment from the authors that chose to depend on the library, but no correlation to actual usage, commitment from upstream implementors and users to use the dependent, and is just as likely to represent herd mentality or a reaction to recent awareness as it is to be a p