30 seconds of code

Short code snippets for all your development needs

Featured Collections

Latest Articles

  • Maximize your productivity when working with a bash or other shell terminal by using these keyboard shortcuts.

  • Wrapping your mind around React hooks and how they interact with setInterval() can be difficult. Here's a guide to get you started.

  • Writing about a topic can often sound boring or worthless. But there are significant benefits to doing it from time to time.

Top Snippets

  • unzipWith

    JavaScript, Array

    Creates an array of elements, ungrouping the elements in an array produced by zip and applying the provided function.

  • kMeans

    JavaScript, Algorithm

    Groups the given data into k clusters, using the k-means clustering algorithm.

  • luhnCheck

    JavaScript, Math

    Implementation of the Luhn Algorithm used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc.

  • Accordion

    React, Components

    Renders an accordion menu with multiple collapsible content elements.

  • get

    JavaScript, Object

    Retrieves a set of properties indicated by the given selectors from an object.