This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s "https://api.pirateweather.net/forecast/<API KEY>/44.7606441,-85.6165301?&units=si&extend=hourly&tz=precise" | jq '.alerts[].title' | |
"Small Craft Advisory issued April 18 at 3:49AM EDT until April 18 at 11:00PM EDT by NWS Gaylord MI" | |
"Small Craft Advisory issued April 17 at 4:03AM EDT until April 18 at 8:00PM EDT by NWS Gaylord MI" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am guillaume on github. | |
* I am gcarbonneau (https://keybase.io/gcarbonneau) on keybase. | |
* I have a public key ASBom3Dhcb-ok-1YTWHCTyQTfVvT5_v98UvdQncCi1B9wAo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Semaphore from "semaphore-async-await"; | |
const fetchPool = poolCount => { | |
const lock = new Semaphore(poolCount); | |
return async function() { | |
await lock.wait(); | |
const res = await fetch.apply(this, arguments); | |
lock.signal(); | |
return res; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const printFoo = (event, context, callback) => { | |
const response = { | |
statusCode: 200, | |
body: JSON.stringify(process.env.FOO) | |
}; | |
callback(null, response); | |
// Use this code if you don't use the http event with the LAMBDA-PROXY integration |