Skip to content

Instantly share code, notes, and snippets.

jeanbenitez / list-to-matrix.ts
Created May 7, 2019 15:25
Simple array to matrix algorithm with Typescript
View list-to-matrix.ts
* Convert simple array into two-dimensional array (matrix)
* @param list The array
* @param width The num of elements per sub-array
* @return the new matrix
export const listToMatrix = <T>(list: T[], width: number): T[][] => {
const matrix = [];
bmaupin /
Last active March 20, 2023 15:38
Free database hosting
ahmadawais /
Created February 19, 2018 06:21 — forked from AllThingsSmitty/
10 terms to help you better understand JavaScript

10 JavaScript Terms You Should Know

From currying to closures there are quite a number of special words used in JavaScript. These will not only help you increase your vocabulary but also better understand JavaScript. Special terms are normally found in documentation and technical articles. But some of them like closures are pretty standard things to know about. Knowing what the word itself means can help you know the concept it's named for better.

  1. Arity
  2. Anonymous
  3. Closure
  4. Currying
  5. Hoisting
  6. Mutation
mateuszsokola /
Last active August 9, 2021 14:36
Pure Functions

Pure functions

A pure function for given the same input will always return the same output and evaluation of this function will not cause any side effects.

Advantages of using pure functions:

  • easy to test, as they always return the same value,
  • easy to debug, as they shouldn't cause any race conditions and circular dependencies,
  • simple and independent, as they don't cause any side effects (it makes design clean),
  • easy to scale application up, as they shouldn't rely on machine state.
nodkz / .babelrc.js
Last active December 26, 2022 11:21
Babel 7.0 with .babelrc.js DEPRECATED! This config was created when babel 7 was in beta
View .babelrc.js
/* eslint-disable prefer-template */
const path = require('path');
const aliases = require('./aliases');
// ///////////////////////////////////////////////////////////////
// ////////////////// PLUGINS ////////////////////////////////
// ///////////////////////////////////////////////////////////////
const commonPlugins = [
yossorion /
Last active March 13, 2023 06:46
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

jlongster /
Last active September 11, 2021 08:32
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

renehamburger / slimdown.js
Last active November 1, 2021 04:21
View slimdown.js
'use strict';
* Javascript version of
* Slimdown - A very basic regex-based Markdown parser. Supports the
* following elements (and can be extended via Slimdown::add_rule()):
* - Headers
* - Links
rexxars / jsondump.jsx
Last active December 19, 2019 05:22
React JSON dump component
View jsondump.jsx
import React from 'react';
class JsonDump extends React.Component {
static propTypes = {
children: React.PropTypes.any
render() {
return <pre>{JSON.stringify(this.props.children, null, 4)}</pre>