View config-overrides.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//install react-app-rewired and all the broswerify packages | |
const webpack = require('webpack'); | |
module.exports = function override(config) { | |
const fallback = config.resolve.fallback || {}; | |
Object.assign(fallback, { | |
"crypto": require.resolve("crypto-browserify"), | |
"stream": require.resolve("stream-browserify"), | |
"assert": require.resolve("assert"), | |
"http": require.resolve("stream-http"), |
View main.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"github.com/gorilla/websocket" | |
) |
View gist:f452ce5e0d5f43162ac55b45795c5808
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useful when testing lamdas for s3 buckets | |
{ | |
"Records":[ | |
{ | |
"eventVersion":"2.2", | |
"eventSource":"aws:s3", | |
"awsRegion":"us-west-2", | |
"eventTime":"The time, in ISO-8601 format, for example, 1970-01-01T00:00:00.000Z, when Amazon S3 finished processing the request", | |
"eventName":"event-type", |
View gist:78f386a15654b451532f8a0a0ff26d50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//client-side code | |
const formik = useFormik({ | |
initialValues: { | |
username: '', | |
bio: '', | |
img: '' | |
}, | |
onSubmit: async (values) => { | |
let data = new FormData(); |