Skip to content

Instantly share code, notes, and snippets.

@fishmandev
fishmandev / vscode-use-response.json
Created June 6, 2023 07:03
vscode use response body
# @name auth
@host = https://api.example.com
POST {{host}}/auth/token/ HTTP/1.1
Content-Type: application/json
{
"email" : "user@example.com",
"password" : "password"
}
@fishmandev
fishmandev / json
Created October 23, 2022 09:20
[HTTP client] Saving the response to a variable
POST https://domain.com/api/login
Content-Type: application/json
{
"email":"email@gmail.com",
"password":"********",
"device":"android"
}
> {% client.global.set("auth_token", response.body.access_token); %}
{
"id": "pi_3L8RufGoWGTstQxK1cj4vSnT",
"object": "payment_intent",
"last_payment_error": null,
"livemode": false,
"next_action": {
"type": "use_stripe_sdk",
"use_stripe_sdk": {
"type": "stripe_3ds2_fingerprint",
"merchant": "acct_1KWI0FGoWGTstQxK",
{
"id": "pi_3L8U2sGoWGTstQxK1XCim6gw",
"object": "payment_intent",
"amount": 108675,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 0,
{
"amount": "108675",
"currency": "usd",
"description": "Heli Payment",
"confirmation_method": "manual",
"confirm": "true",
"metadata": {
"adventure_name": "Ooops",
"operator_name": "CAD-Operator Business Name",
"order_number": "4D824A8A0",
{
"code": "200",
"status": "OK",
"message": "Success",
"default_payment_method_id": 1, // This field can be nullable!
"data": [
{
"id": 1,
"payment_method_id": "pm_12345FX345",
"type": "card",
@fishmandev
fishmandev / py
Created May 1, 2020 12:55
MH-Z19B
#!/usr/bin/python
import serial, os, time, sys, struct
def crc8(a):
crc=0x00
count=1
b=bytearray(a)
while count<8:
crc+=b[count]
count=count+1