Skip to content

Instantly share code, notes, and snippets.

View ma3yta's full-sized avatar

Andrii Maksymets ma3yta

View GitHub Profile
[*.fs]
fsharp_experimental_stroustrup_style = true
fsharp_multiline_block_brackets_on_same_column = true
@ma3yta
ma3yta / await_example.nim
Created September 3, 2022 10:04
Nim await example
import asyncdispatch
import httpclient
proc asyncGet(url: string): Future[string] {.async.} =
var client = newAsyncHttpClient()
result = await client.getContent(url)
proc asyncGetAll(urls: seq[string]): Future[seq[string]] {.async.} =
var futures = newSeq[Future[string]](len(urls))
for i, url in urls.pairs():
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)