Skip to content

Instantly share code, notes, and snippets.

View richard-flosi's full-sized avatar

Richard Flosi richard-flosi

  • Remote, US
View GitHub Profile
@richard-flosi
richard-flosi / operations.js
Created April 27, 2020 19:49
serverless express-openapi over netlify functions
const usersApi = require("./users");
module.exports = {
// /users
"post-users": usersApi.post,
"get-users": usersApi.get,
// /users/{userId}
"get-users-userId": usersApi.get,
"patch-users-userId": usersApi.patch,
"delete-users-userId": usersApi.delete,
@richard-flosi
richard-flosi / build.sh
Created July 14, 2020 00:08
Build Script to Deploy Flutter Web app on Netlify
#!/bin/bash
# Get flutter
git clone https://github.com/flutter/flutter.git
FLUTTER=flutter/bin/flutter
# Configure flutter
FLUTTER_CHANNEL=master
FLUTTER_VERSION=v1.17.0
$FLUTTER channel $FLUTTER_CHANNEL
@richard-flosi
richard-flosi / async-generator.js
Created February 23, 2022 21:49
Example of *yield to pass proxy to another function compared to awaiting each next() value and applying a transformation before yielding
// When you just need to pass through the value yield from another generator function use:
yield* generatorFunction();
// When you need to manipulate each yielded value
const generator = generatorFunction();
let next = await generator.next();
while (!next.done) {
let value = next.value;
// TODO apply any transformations to value here
yield value;