Skip to content

Instantly share code, notes, and snippets.

View beetcb's full-sized avatar
:octocat:
contributing

beet beetcb

:octocat:
contributing
View GitHub Profile
@beetcb
beetcb / ArrayDeduplication.js
Last active August 29, 2020 07:00
Array Deduplication
array.filter(function (item, position) {
return array.indexOf(item) == position
})
@beetcb
beetcb / GroupJson.js
Last active August 29, 2020 06:58
GroupJsonData.js
const grabRickAndMorty = {
info: {
count: 591,
pages: 30,
next: 'https://rickandmortyapi.com/api/character/?page=2',
prev: null,
},
results: [
{
id: 1,
@beetcb
beetcb / realDeepClone.js
Last active August 29, 2020 06:52
clone a object's flags
// using spread expression
let [one, two, three] = [...'12', { ...'abc' }]
const obj = { one, two, three }
function realDeepClone(obj, key, clone) {
if (!key) {
clone = Object.defineProperties({}, Object.getOwnPropertyDescriptors(obj))
} else {
clone[key] = Object.defineProperties(
{},
@beetcb
beetcb / semantic-commit-messages.md
Created August 23, 2020 14:35 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example