Skip to content

Instantly share code, notes, and snippets.

// Option 1
// if you know that you only want 2
let per_page = 100
let responses = await Promise.all([
app.$storyapi.get('cdn/stories/', {
starts_with: 'posts/',
per_page: per_page,
page: 1
}),
app.$storyapi.get('cdn/stories/', {
@stub4ever
stub4ever / forecast.js
Created August 20, 2020 15:31 — forked from marklchaves/forecast.js
How to read in an environment variable on Netlify using a lambda function.
/**
* This was a proof of concept for me to be able to
* retrieve an API key using a Netlify environment variable
* using this lambda function. I spent a lot of time looking
* for a complete example like this--without any luck.
*
* So, here's a step-by-step of what I did.
*
* 1) For this function to work, define the env variable in
* Netlify > Site > Build & Deploy > Environment > Edit Variables
@stub4ever
stub4ever / resize-image.js
Created November 29, 2019 13:42 — forked from BilalQadri/resize-image.js
Resize Image (keeping aspect ratio) of HTML with Javascript
// jquery required
// maxWidth and maxHeight can be parameters for more flexibility
function (img_ref) {
var img = $(img_ref);
img.on('load', function () {
img.css("width", "auto");
img.css("height", "auto");
@stub4ever
stub4ever / gist:4b8fbd71ee2f729b6c6d279e468a4fa7
Created April 12, 2019 06:57 — forked from bradwestfall/gist:f5a010e96fb0c4d18556
Pull Instagram Images via JavaScript
@stub4ever
stub4ever / installing-node-with-nvm.md
Created May 23, 2018 19:05 — forked from d2s/installing-node-with-nvm.md
Installing Node.js for Linux & macOS with nvm