@maz@niu.moe that’s true now i remember that...

@maz@niu.moe tried that and it tasted like kitkat... :/

@thor@snabeltann.no @mattskala but i agree with you that it would be nice if JS could natively support parallelizing or serializing execution via more syntactic sugar such as:

let res = await parallel requestA(), requestB();

Promise.all() feels ugly and old :P

@thor@snabeltann.no @mattskala typo.. should be:

let res = await Promise.all(requestA(), requestB());

@thor@snabeltann.no @mattskala if you want parallel execution you and await on a Promise.all():

async function requestA() ...
async function requestB() ...
let res = await Promise.all(requestA, requestB);
// process results from both requests

@thor@snabeltann.no @mattskala for async-await this is a good introduction: javascript.info/async-await

basically an async function always returns a promise. await "waits" for the promise to resolve and execute the next line in your code.

the best thing is you can write asynchronous code just as if you are writing synchronous code, and you can try-catch any asynchronous failure.

very simple example:
try {
let res = await makeHttpCall(URL);
// process result
} catch (err) {
// catch error.

@mattskala @thor@snabeltann.no what you described is basically async-await?

@g yeah.. it's really hard to get all use cases covered so the better route, if possible, is to urlencode any attribute values.

@g how about this:

@g hmm you are right my regex would balk at your html string inside data-tag. i need to fix it by also matching attr=value pairs inside any tags...

Four Legs boosted


溝通好重要。(Part 2)

我當時好清楚地提醒主人「佢而家個樣咁精神純粹係因為有鹽水幫佢吊命,一切都係假象。鹽水一拆佢只可以頂到 24-48小時,我希望你哋做定心理準備」


48 小時後,未見佢哋帶狗狗黎診所,我打返去問,佢哋話我知大概到第 26 小時開始,狗狗不停瞓,之後陷入昏迷,之後好安詳地走了。



一) 「溝通」。其實只要你用心同主人溝通,我相信好多主人都會感受到。主人需要嘅唔係 false hope。(橫蠻主人例外,下回分享)

二) 動物表現同佢真實病情無絕對關係,所以主人們唔好單憑你嘅寵物「睇落好精神」而認為佢健康無問題,到最終醫唔返就話係醫生唔識醫

三) 你嘅寵物同你一樣,唔鍾意孤令令一個留院,可以嘅話多D 去探佢哋,比多 D 支持佢哋 - 當然要就返個別醫院嘅探病時間啦。

Four Legs boosted


溝通好重要。(Part 1)







@zangetsu_MG cool thx for the pointer! this reminds me of sierra outpost, a really old game.

@g pretty much! it's a regex for html5 tags with 4 capture groups - open tags (e.g. <div>), close tags (e.g. </div>), self closing tags (e.g. <br />), and a substitution variables (${xxx}).

just wrote an ugly regex...


.\ /. -___- X___X

@varx @zperrault yeah i know... i've dripped my own coffee every morning for years so i might be a good candidate for category two :)

Show older
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!