Skip to content

Instantly share code, notes, and snippets.

View phthhieu's full-sized avatar

Hieu Pham (Andromeda / Platform Pillar) phthhieu

View GitHub Profile
@hanh090
hanh090 / memoize1.js
Last active March 18, 2020 02:26
Correct way to using memoize in EH project
// Import memoize from lodash fp package - it is convention in EH project
import memoize from 'lodash/fp/memoize';
// in lodash functional programming, memoize only have 1 argument
// this is code to changed to original API which support keyResolver
const memoizeWithResolver = memoize.convert({ fixed: false });
const keyResolver = (...args) => JSON.stringify(args);// Just sample code, you can choose method which you prefer
const withMemo = memoizeWithResolver((a,b) => doSomethingWith(a,b), keyResolver)
@AllenDang
AllenDang / gccemacs.md
Last active July 7, 2024 09:42
Build gccemacs on MacOS catalina with gcc 10 installed by homebrew.
@victorlin
victorlin / github-delete-stale-branches.js
Last active March 20, 2024 02:27
Delete stale branches from the GitHub repo's stale branches page (github.com/user/repo/branches/stale). Originally from https://stackoverflow.com/a/69089905
// Paste in browser console and run
async function deleteStaleBranches(delay=500) {
var stale_branches = document.getElementsByClassName('js-branch-delete-button');
for (var i = 0; i < stale_branches.length; i++)
{
stale_branches.item(i).click();
await new Promise(r => setTimeout(r, delay));
}
}

layout: blog title: Explore Memoization date: 2019-07-18T16:20:16.898Z author: Toan Nguyen Gia authorAvatar: /img/uploads/t0d8dq73q-u9hr7hu1m-706d3758d60e-512.jpeg image: /img/uploads/deco-iskusstvoa-helix.jpg tags:

  • Tech
  • Javascript