Skip to content

Instantly share code, notes, and snippets.

View zahra-ove's full-sized avatar

zahra oveyedzade zahra-ove

View GitHub Profile

Elasticsearch In action Books ... important notes

  1. what is elasticsearch?
    Elasticsearch is a powerful and popular open source distributed search and analytics engine.

  2. Structured vs. unstructured (full-text) data
    Data predominantly comes in two flavors: structured and unstructured. The fundamental differentiator between these two categories is the way the data is stored and analyzed. Structured data follows a predefined schema/model, while unstructured data is free-form, unorganized, and schema-free

redis config file:\

/etc/redis.conf

remove all keys in redis:

flushall

from book: Elasticsearch: The definitive guide

  1. Test it out by opening another terminal window and running the following:\
curl http://localhost:9200/?pretty
  1. A node is a running instance of Elasticsearch. A cluster is a group

PHQL

  1. PHQL (Phalcon Query Language) in the Phalcon framework is a high-level, object-oriented SQL dialect designed to interact with databases through Phalcon's ORM.

  2. Relationship Handling:

Simplifies joins using predefined model relationships. For example, if User is related to Post, you can write:

  1. using array_filter without callback function:

In PHP, the array_filter function is used to filter elements of an array using a callback function. However, if no callback function is provided, it will filter out falsy values by default. Behavior of array_filter($categoryIds) without a callback

If array_filter is used without a callback, it removes elements that evaluate to false in a Boolean context. Specifically, it filters out:

false
0 (integer and string "0")

null

Growing object oriented software guided by test Notes

  1. test drive development (p. 17)

  2. Alan Kay’s1 concept of objects being similar to biological cells that send each other messages.

  3. let the tests guide development.

  4. We use the tests to clarify our ideas about what we want the code to do. (p. 5)

  5. When we’re implementing a feature, we start by writing an acceptance test, which exercises the functionality we want to build. While it’s failing, an acceptance

important notes from book: "Unit testing Principles, Practices and Patterns by Viladimir Khorikov"

  1. AAA (Arrange, Act, Assert) or Given-When-Then

  2. A unit in unit testing is a unit of behavior, not a unit of code. A single unit of behavior can exhibit multiple outcomes, and it’s fine to evaluate them all in one test. (p. 69)

  3. Having that said, you need to watch out for assertion sections that grow too large: it could be a sign of a missing abstraction in the production code. (p. 69)

  1. One of the benefits of Laravel Octane is the huge improvement in the response times to HTTP requests by clients such as web browsers. p.20

  2. Laravel Octane, through application servers, does just that: optimizes the process of starting the framework, which typically happens for each individual request. We will see in detail how this is done; essentially, the objects and everything that the framework needs are started and allocated to the start of the application server, and then the instances are made available to the various workers. Workers are the processes that are initiated to serve the requests. p.20

  3. some features of swoole application server: p.21