I hereby claim:
- I am joeyguerra on github.
- I am joeyguerra (https://keybase.io/joeyguerra) on keybase.
- I have a public key ASBDxkxeKV2rhI1xg9U9HoLNphwjWh_qk2Sj5V969ys6fAo
To claim this, I am signing this object:
(function(module){ | |
var observers = []; | |
module.exports.notificationcenter = { | |
publish: function(notification, publisher, info){ | |
var ubounds = observers.length; | |
var i = 0; | |
for(i; i<ubounds; i++){ | |
if(!observers[i]) continue; | |
if(observers[i].notification != notification) continue; | |
if(observers[i].publisher != null && observers[i].publisher != publisher) continue; |
I hereby claim:
To claim this, I am signing this object:
const pipe = (...fns) => x => fns.reduce((y, f) => f(y), x) |
import assert from "assert" | |
describe("PropertyFile - externalize configuraiton with environment variables", ()=>{ | |
it("Should parse an env file", async done => { | |
const env = ` | |
CLIENT_ID="something" | |
CLIENT_SECRET="something" | |
# something id | |
ID=1 | |
` | |
let config = {} |
import assert from "assert" | |
import http2 from "http2" | |
//using mocha | |
describe("Http2", ()=>{ | |
it("Should make a get request to google with http2", done => { | |
const uri = "https://www.google.com" | |
const client = http2.connect(uri); | |
const req = client.request({ | |
[http2.constants.HTTP2_HEADER_SCHEME]: "https", | |
[http2.constants.HTTP2_HEADER_METHOD]: http2.constants.HTTP2_METHOD_GET, |
Notification.requestPermission(); | |
setInterval(async ()=>{ | |
let data = await (await fetch("https://api.coindesk.com/v1/bpi/currentprice.json")).json(); | |
document.body.innerHTML = `${data.time.updated}:%20${data.bpi.USD.rate}`; | |
if(Notification.permission == "granted") new Notification(`BitCoin Price: $${data.bpi.USD.rate}`); | |
},10000); |
docker run --rm -it --name redis-cli redis redis-cli -h $IPADDRESS -a $REDIS_PASSWORD |
#!/bin/zsh | |
# example run: ./init.sh git@github.com:joeyguerra/100-days-of-code.git | |
git init | |
git remote add origin $1 | |
git add . | |
git commit -m "initial commit" | |
git push -u origin main |
f(events) -> state | |
match f(state, event) -> state | |
f(state, command) -> events |
import assert from 'assert'; | |
describe('Debounce', ()=>{ | |
it('When called super fast, then should only increment once', done=>{ | |
const debounce = timer => (fn, timeout) => { | |
clearTimeout(timer); | |
timer = setTimeout(fn, timeout); | |
return timer; | |
}; | |
let timer = null | |
let actual = 0; |