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
[ | |
{ | |
"key": "cmd+[Semicolon]", | |
"command": "workbench.action.terminal.toggleTerminal" | |
}, | |
{ | |
"key": "ctrl+shift+[Equal]", | |
"command": "-workbench.action.terminal.toggleTerminal" | |
}, | |
{ |
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
func uploadImage(w http.ResponseWriter, r *http.Request) { | |
// Create buffer to read magic number of uploaded file | |
magicNumber := make([]byte, 3) | |
// Read first 3 bytes of uploaded file | |
_, err := r.Body.Read(magicNumber) | |
// handle err | |
// Check magic number against png, jpg, gif | |
// https://en.wikipedia.org/wiki/List_of_file_signatures |
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 ( | |
"encoding/json" | |
"errors" | |
"net/http" | |
"github.com/go-chi/chi" | |
) |
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 ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"github.com/go-chi/chi" | |
) |
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
version: "3" | |
services: | |
db: | |
image: postgres | |
ports: | |
- 5432:5432 | |
environment: | |
POSTGRES_PASSWORD: secret |