Skip to content

Instantly share code, notes, and snippets.

View Berkmann18's full-sized avatar
💭
Very busy with work, life and such.

Maximilian Berkmann Berkmann18

💭
Very busy with work, life and such.
View GitHub Profile
@Berkmann18
Berkmann18 / fixNodeModules.sh
Created October 9, 2018 11:13
Fix NPM errors on node modules listing
#!/bin/bash
echo Removing packages...
rm -rf node_modules/
rm -rf ~/.node-gyp/
echo Re-installing...
npm i --no-optional
echo Deduplicating modules
npm dedupe
@Berkmann18
Berkmann18 / .czrc
Created October 9, 2018 19:04
Commitizen configuration
{ "path": "cz-adapter-eslint" }
@Berkmann18
Berkmann18 / arrayTester.js
Last active November 14, 2018 12:40
Stress test helpers for arrays
/**
* @description Generate indexes used to access an array.
* @param {number} len Length of the array
* @param {number} [bound=1] How much the boundaries needs to be extended by
* @param {number} [mult=1] How the resulting array of index needs to be multiplied by
* @returns {number[]} Array of indexes
* @example
* let arr = ['lorem', 'ipsum', 'dolore'];
* genIdxs(arr.length); //[-4, -3, -2, -1, 0, 1, 2, 3, 4]
* genIdxs(arr.length, 2); //[-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]
@Berkmann18
Berkmann18 / NativeVsLodashVsUnderscore
Created December 25, 2018 01:40
Native vs utils in JS
lodash:
lodash:
underscore:
lodash x 1,953,456 ops/sec ±6.70% (8 runs sampled)
lodash x 652,528,932 ops/sec ±0.45% (8 runs sampled)
lodash x 651,440,427 ops/sec ±1.26% (8 runs sampled)
lodash x 27,988,482 ops/sec ±31.89% (12 runs sampled)
lodash x 18,453,853 ops/sec ±4.08% (9 runs sampled)
lodash x 1,604,663 ops/sec ±11.14% (9 runs sampled)
underscore:
@Berkmann18
Berkmann18 / labels.json
Last active January 31, 2019 15:36
My GH labels
[
{
"name": "Priority: Critical",
"color": "FF0000"
},
{
"name": "Priority: High",
"color": "FF8000"
},
{