Skip to content

Instantly share code, notes, and snippets.

View flybayer's full-sized avatar
🤓
CEO Flightcontrol + Pilot

Brandon Bayer flybayer

🤓
CEO Flightcontrol + Pilot
View GitHub Profile
@flybayer
flybayer / blitz-image-upload-rfc.md
Last active March 16, 2021 16:59 — forked from cstrnt/blitz-image-upload-rfc.md
[RFC] Add easy image uploads to Blitz

Problem

As of right now it's not trivial to upload images in Blitz. People either use external services like Cloudinary to handle this stuff. Creating your own solution includes knowledge in the fields of form parsing and some really low level libraries like busboy.

Solution

The goal is to create a hook which allows easy image uploads. There will also be a api route which takes care of the parsing part and then allows saving the file to the disk or uploading it a S3 etc. I'm the creator of imghop and I plan on using the same / similar api for this functionality. Example:

@flybayer
flybayer / start.js
Created August 30, 2016 15:58 — forked from toddgeist/start.js
Using dotenv to load vars when dploying to now. But still keep it out of your repo.
// load as early as possible
if(process.env.NOW){
require('dotenv').config({path:'./.envnow', silent:true});
}else{
require('dotenv').config({silent:true});
}
// now you can deploy with:
//$cp .env .envnow && now && rm -r .envnow
@flybayer
flybayer / challenge.adoc
Last active January 12, 2016 19:46 — forked from cheerfulstoic/graph_gist_template.adoc
My Submission

TODO

  1. Create many more nodes

  2. Create queries for the questions

  3. Review questions & maybe add more or more complexity

  4. Create domain model image

What can I eat for the holidays??