Skip to content

Instantly share code, notes, and snippets.

@Yopadd
Yopadd / async-flat-map.js
Created February 16, 2018 07:15
return a flatten map resolved by async function
async function asyncFlatMap (arr, asyncFn) {
return Promise.all(flatten(await asyncMap(arr, asyncFn)))
}
function asyncMap (arr, asyncFn) {
return Promise.all(arr.map(asyncFn))
}
function flatMap (arr, fn) {
return flatten(arr.map(fn))
@tzmartin
tzmartin / embedded-file-viewer.md
Last active April 22, 2024 19:39
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links