This file contains hidden or 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
# See https://leetcode.com/problems/invert-binary-tree/ | |
# for brief and inputs | |
from collections import deque | |
from typing import Union, cast | |
# Note that we use the Union type rather than the pipe syntax | |
# as the version of Python in this project's pyenv | |
# doesn't support recursive types using the latter. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
} |
NewerOlder