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
curl -X 'POST' https://<HOST>/sdapi/v1/txt2img \ | |
-H 'accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"prompt": "Photo of a man eating an egg", | |
"negative_prompt": "", | |
"seed": -1, | |
"subseed": -1, | |
"subseed_strength": 0, | |
"seed_resize_from_h": -1, |
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
$ docker run --rm --runtime=nvidia --gpus all -e NVIDIA_VISIBLE_DEVICES=all \ | |
-v ./blendervol:/blendervol \ | |
nytimes/blender:3.3.1-gpu-ubuntu18.04 \ | |
blender -b /blendervol/monster_under_the_bed_sss_demo_by_metin_seven.blend -o blendervol/monster_CONTAINER.jpg -F JPEG -f 1 -E CYCLES -- --cycles-device CUDA |
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
'use strict'; | |
const http = require('http'); | |
const getQuote = () => | |
new Promise((resolve, reject) => { | |
http.get('http://ron-swanson-quotes.herokuapp.com/v2/quotes', res => { | |
res.setEncoding('utf8'); | |
let data = ''; |
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
'use strict'; | |
const { parseHTML } = require('linkedom'); | |
const createSerialiser = serialiser => | |
element => { | |
let result = ''; | |
const traverse = el => { | |
const serialisedEl = serialiser(el, result.length); |
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
{ | |
"message": "Invalid request body" | |
} |
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
$ curl -XPOST "https://xxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/production/events" \ | |
-H "Content-Type: application/json" \ | |
-H "x-api-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ | |
-d '{ | |
"deviceID": "8f188304-e7b3-4a16-a243-b9470468478a", | |
"eventType": "temp_celcius", | |
"value":3 | |
}' |
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
$ curl -XPOST "https://xxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/production/events" \ | |
-H "Content-Type: application/json" \ | |
-H "x-api-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ | |
-d '{ | |
"date": "'$(date -u +%FT%TZ)'", | |
"deviceID": "8f188304-e7b3-4a16-a243-b9470468478a", | |
"eventType": "temp_celcius", | |
"value":3 | |
}' |
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
$ aws ecr get-login-password --region <AWS region> | docker login --username AWS --password-stdin <AWS account ID>.dkr.ecr.<AWS region>.amazonaws.com |
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
variable "region" { | |
description = "The AWS region to which the lambdas and AWS-backed Atlas cluster are deployed" | |
type = string | |
} | |
variable "atlas_org_id" { | |
description = "The ID of your MongoDB Atlas organisation" | |
type = string | |
} |
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
resource "aws_api_gateway_rest_api" "api" { | |
name = "iot-events" | |
} | |
resource "aws_api_gateway_model" "event" { | |
rest_api_id = aws_api_gateway_rest_api.api.id | |
name = "event" | |
description = "Event information sent from a device" | |
content_type = "application/json" |
NewerOlder