A useful collection of JavaScript snippets
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
IntervalTimer.js
README.md
ago.js
createElement.js
debounce.js
formatDate.js
fuzzy.js

README.md

In the Lost Kingdom of JavaScript - The Vanilla Snippets

A useful collection of JavaScript snippets

Fuzzy

A tiny and blazing-fast fuzzy search in JavaScript (stolen (but modified) from @bevacqua)

Create Element

Quick and easy DOM element creation

Debounce

A function, that, as long as it continues to be invoked, will not be triggered (good for preventing spam from input events). (Supports React)

IntervalTimer

A pause-able interval timer, great for looping banners that you want to pause on hover. Once un-paused, it will wait out the amount of time it would have had to wait if not paused, before continuing.

Format Date

A JS implementation of PHP's date formatter. Originally from https://github.com/jacwright/date.format, modified, tidied, and updated for ES6.

Ago

Convert the given Date or timestamp to words, "2 days ago".


TODO

  • Add usage examples