Mac OS X Catalina
ab -c 300 -n 1000 https://super.com/api
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 "http://example.com/api/v1/locations/" |
Preferences --> Editor --> Code Style --> Typescript/JavaScript --> Punctuation [Tab] --> Use [Single] quotes in [New Code]
Preferences --> Editor --> Code Style --> Typescript/JavaScript --> Spaces [Tab] --> Scroll to section "Within" and check ES6 import/export braces
Для проектов среднего и небольшого размера не всегда оправданно использовать AWS/Kubernetes подобную технологию. Для проектов нуждающихся в нескольких серверах отлично подходит Digital ocean. Который к тому же предоставляет средства вертикального скейлинга(увеличение производительной мощности уже существующих серверов).
Создаем сертификат под которым будем логинится на сервера нашего проекта (на локальной машине)
ssh-keygen -t rsa -b 4096 -f /Users/alex/.ssh/myproject_test -C "myproject comment"
Не забываем сделать его бекап
static async listPostsPublicRaw ({ offset, limit, filter = {} } = {}) {
assert.integer(limit, { required: true, min: 10 })
assert.integer(offset, { required: true, min: 0 })
assert.validate(filter.blogId, BlogModel.schema.id, { required: true })
assert.validate(filter.stackId, StackModel.schema.id)
importScripts('https://www.gstatic.com/firebasejs/7.8.2/firebase-app.js') | |
importScripts('https://www.gstatic.com/firebasejs/7.8.2/firebase-messaging.js') | |
firebase.initializeApp({ | |
apiKey: "---", | |
authDomain: "test.firebaseapp.com", | |
databaseURL: "https://test.firebaseio.com", | |
projectId: "test", | |
storageBucket: "test.appspot.com", | |
messagingSenderId: "11111111111", |