The following was written to act as a Google Cloud Function or Lambda, and sends a simple POST to a standard rest endpoint at https://krypted.com/api/v1/sites with the json defined in jsonObject. The endpoint can easily be changed in http.NewRequest or converted to a variable. The response to the POST is then returned as stdout. package main import ( "fmt" "net/http" "encoding/json" ) func main() { // Create a new HTTP client. client := &http.Client{} // Create a new JSON object. jsonObject := map[string]string{ "name": "Krypted", "site": "www.krypted.com", } // Marshal the JSON object to a string. jsonString, err := json.Marshal(jsonObject) if err != nil { fmt.Println(err) return } // Create…
-
-
Tiny hex and binary converters in swift, go, python, && javascript
Have a few scripts that I’ve been bringing into projects for awhile (and altering for each so ymmv on the state, but you’ll get the general idea). https://github.com/krypted/tinyconverters As the names and file extensions imply, these simply take ascii as an input and output as binary or hex, or take the binary or hex and output as ascii.