https://habr.com/ru/post/358950/
Тестируют один юнит функциональности.
Не должны ходить в базу или внешние сервисы.
| ;; dataset size: 10 users, 200 clients, 30k invoices | |
| (time | |
| (let [client-ids | |
| (->> | |
| (xt/q (db) | |
| '{:find [?client] | |
| :where [[(lucene-text-search | |
| "client\\/first-name: %1$s* OR client\\/last-name: %1$s* OR client\\/company-name: %1$s*" | |
| ?s-str) |
| -- Check "JSONB storage does not deduplicate the key names in the JSON. This can result in considerably larger storage footprint.. " from https://scalegrid.io/blog/using-jsonb-in-postgresql-how-to-effectively-store-index-json-data-in-postgresql/ | |
| create table jt_1 (a integer, b numeric, c text); | |
| create table jt_2 (data jsonb); | |
| create table jt_3 (data jsonb); | |
| create table jt_4 (data jsonb); | |
| -- 10 million records for jt_1 and jt_2 | |
| insert into jt_1 SELECT (random() * 100000)::integer, | |
| (random() * 1000000)::numeric, |
https://habr.com/ru/post/358950/
Тестируют один юнит функциональности.
Не должны ходить в базу или внешние сервисы.
| package main | |
| import ( | |
| "testing" | |
| "github.com/stretchr/testify/require" | |
| ) | |
| type eee struct{} |
| - hosts: localhost | |
| connection: local | |
| gather_facts: false | |
| tasks: | |
| - name: add a couple of keys to an authorized_keys file | |
| authorized_key: path='./keys' user=sgargan key="{{ lookup('file', './ansible.pub') }}" | |
| - authorized_key: path='./keys' user=sgargan key="{{ lookup('file', './sgargan.pub') }}" |
| /* | |
| go test str_conc_test.go -bench . -benchtime 10s | |
| BenchmarkConcatOne-4 2000000 7684 ns/op | |
| BenchmarkConcatTwo-4 5000000 2883 ns/op | |
| BenchmarkConcatThree-4 5000000 2933 ns/op | |
| PASS | |
| ok command-line-arguments 56.982s | |
| */ | |
| package main |
| -*- mode: grep; default-directory: "/usr/local/go/src/" -*- | |
| Grep started at Mon Apr 3 17:48:57 | |
sudo usermod -aG docker $USERhttps://docs.docker.com/compose/install/| <?php | |
| if (!function_exists('array_replace_recursive_overwrite')) { | |
| function array_replace_recursive_overwrite($array, $array1) | |
| { | |
| $recurse = function ($array,$array1) use (&$recurse) | |
| { | |
| foreach ($array1 as $key => $value) { |
Dockerfile that is based on your production image and
simply install xdebug into it. Exemple:FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \