Skip to content

Instantly share code, notes, and snippets.

View cstrnt's full-sized avatar
🦑
Living la vida loca

Tim Raderschad cstrnt

🦑
Living la vida loca
View GitHub Profile
@cstrnt
cstrnt / blitz-image-upload-rfc.md
Last active March 16, 2021 16:07
[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:

// index.jsx
@cstrnt
cstrnt / dockernames.js
Created April 15, 2019 13:54
Docker Name Generator
const left = [
...'admiring',
'adoring',
'affectionate',
'agitated',
'amazing',
'angry',
'awesome',
'beautiful',
'blissful',
{
"workbench.colorTheme": "Cobalt2",
"editor.fontFamily": "Operator Mono Lig, Firicico, Fira Code, Consolas, 'Courier New', monospace",
"editor.fontLigatures": true,
"explorer.confirmDragAndDrop": false,
"extensions.ignoreRecommendations": false,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',