Skip to content

Instantly share code, notes, and snippets.

@ryan-k8
ryan-k8 / redis-docker-for-mac.md
Created August 26, 2024 17:27 — forked from simonw/redis-docker-for-mac.md
How to run a redis server using Docker-for-Mac

How to run a redis server using Docker-for-Mac

This will work with other flavours of Docker as well.

Run the following command:

docker run --name my-redis -p 6379:6379 --restart always --detach redis

This will download and run redis, set to auto-restart when your machine starts and bound to port 6379 on your machine.

@ryan-k8
ryan-k8 / filesystemapi_demo.js
Created April 10, 2022 09:51
filesystem api
async getFileStream(file) {
return {stream:URL.createObjectURL(file),type:file.type}
}
async function getDir() {
const dirHandle = await window.showDirectoryPicker();
for await (const entry of dirHandle.values()) {
if(entry.kind=='directory') {
console.log('directory--------',entry.name)
for await(const subentry of entry.values()) {