Skip to content

Instantly share code, notes, and snippets.

View guillaume's full-sized avatar

Guillaume Carbonneau guillaume

View GitHub Profile
@guillaume
guillaume / gist:5ce472a173b6b515d9c5ff7e76ea8cef
Created April 18, 2023 12:51
example pirateweather alerts
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"
### 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:
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;
@guillaume
guillaume / handler.js
Created June 9, 2017 13:34
serverless offline bug with env variables
"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