Skip to content

Instantly share code, notes, and snippets.

View iamogbz's full-sized avatar
🕺
staring at the man in the machine

Emmanuel Ogbizi iamogbz

🕺
staring at the man in the machine
View GitHub Profile
@iamogbz
iamogbz / cheerio.js
Last active July 19, 2023 06:30
cheerio
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=113)}([function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){var n=r(74),i="object"==typeof self&&self&&self
@iamogbz
iamogbz / notes.md
Last active July 13, 2020 13:28
Remote Docker AWS

Errors

  1. $ rd create-keypair

Your public key has been saved in Usersemmanuelogbiziugbe sshrd_rsa pub

Tries to load the default which has not been created because I used a different name “rd_rsa” and have no config file

  1. $ rd create-keypair Fails if the file already exists
@iamogbz
iamogbz / useEffectOnceWhen.js
Last active July 1, 2023 08:40
One shot `useEffect` hook based on a predicate
function useEffectOnceWhen(effect, deps, predicate) {
const [hasRun, setHasRun] = useState(false)
const effectCallback = useCallback(effect, deps)
const shouldRun = useMemo(() => {
if (hasRun) return false
return Boolean(typeof predicate === 'function' ? predicate() : predicate)
}, [hasRun, predicate])
useEffect(() => {
if (!shouldRun) return
return setHasRun(true), effectCallback()
@iamogbz
iamogbz / process.env.test.js
Last active July 19, 2023 06:23
Node Process Env Test
let value;
checkProp = (o, p) => {
console.log("value", JSON.stringify(o[p]));
console.log("hasProperty", p, Object.prototype.hasOwnProperty.call(o, p));
console.log("ownProperty", p, Object.getOwnPropertyNames(o).includes(p));
console.log();
};
runTests = object => {