Skip to content

Instantly share code, notes, and snippets.

View bhatti's full-sized avatar

Shahzad Bhatti bhatti

View GitHub Profile
Database Default Isolation Financial Safety
PostgreSQL READ COMMITTED ❌ Vulnerable
MySQL REPEATABLE READ ⚠️ Better but not perfect
Oracle READ COMMITTED ❌ Vulnerable
SQL Server READ COMMITTED ❌ Vulnerable
H2/HSQLDB READ COMMITTED ❌ Vulnerable
Database Default Isolation Financial Safety
PostgreSQL READ COMMITTED ❌ Vulnerable
MySQL REPEATABLE READ ⚠️ Better but not perfect
Oracle READ COMMITTED ❌ Vulnerable
SQL Server READ COMMITTED ❌ Vulnerable
H2/HSQLDB READ COMMITTED ❌ Vulnerable
@bhatti
bhatti / m3.sh
Last active December 14, 2022 19:39
./out/bin/api-mock-service -h
Starts mock service
Usage:
api-mock-service [flags]
api-mock-service [command]
Available Commands:
chaos Executes chaos client
completion Generate the autocompletion script for the specified shell
docker pull plexobject/api-mock-service:latest
docker run -p 8000:8080 -p 8081:8081 -e HTTP_PORT=8080 PROXY_PORT=8081 -e DATA_DIR=/tmp/mocks \
-e ASSET_DIR=/tmp/assets plexobject/api-mock-service:latest
@bhatti
bhatti / m20.sh
Last active November 3, 2022 02:08
curl -H "Content-Type: application/yaml" --data-binary @fixtures/lines.txt \
http://localhost:8080/_fixtures/GET/lines.txt/devices
curl -v -H "Content-Type: application/yaml" --data-binary @fixtures/props.yaml \
http://localhost:8080/_fixtures/GET/props.yaml/devices
@bhatti
bhatti / m18.json
Last active November 3, 2022 01:54
{ "Devices": [
{
"Udid": "fe49b338-4593-43c9-b1e9-67581d000000",
"Line": { "ApplicationName": "Chase", "Version": "3.80", "ApplicationIdentifier": "com.chase.sig.android", "Type": "Public", "IsManaged": false },
"Amount": {"currency":"$","value":100},
"SerialNumber": "47c2d7c3-c930-4194-b560-f7b89b33bc2a",
"MacAddress": "1e015eac-68d2-42ee-9e8f-73fb80958019",
"Imei": "5f8cae1b-c5e3-4234-a238-1c38d296f73a",
"AssetNumber": "9z0CZSA03ZbUNiQw2aiF",
"LocationGroupId": {
"Amount": {{JSONFileProperty "props.yaml" "amount"}},
"Amount": {{JSONFileProperty "props.yaml" "amount"}},
@bhatti
bhatti / m16.sh
Last active November 2, 2022 19:03
> GET /v1/customers/123/cash_balance?page=2&pageSize=55 HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.65.2
> Accept: */*
> Authorization: Bearer sk_test_0123456789
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json
< X-Mock-Request-Count: 1
@bhatti
bhatti / m31.yaml
Last active November 2, 2022 18:25
name: UpdateAuthTokenPromotion-xx
path: /v1/AuthTokens/Promote
description: Promote the secondary Auth Token to primary. After promoting the new token, all requests to Twilio using your old primary Auth Token will result in an error.
request:
match_query_params: {}
match_headers: {}
match_content_type: ""
match_contents: ""
example_path_params: {}
example_query_params: {}