Skip to content

Instantly share code, notes, and snippets.

View percyvega's full-sized avatar

Percy Vega percyvega

View GitHub Profile

Help

$ docker --help
$ docker image --help
$ docker image ls --help

Versions

See the Docker version

$ docker --version

MongoDB

Terms

Database -> Collections -> Documents -> Fields

Concepts

Sharding (Data Partition, Horizontal Partition):

Breaks up the data among multiple servers.

List

List current directory's directories
	ls -ld *
List current directory's directories and their files:
	ls -l *
List current directory's contents recursively:
	ls -lR
List specified directory's contents:

ls dir123 -ltr

CONCEPTS

Take a clone of a remote repository and run git branch -a (to show all the branches git knows about). It will probably look something like this:
	* master
	  remotes/origin/HEAD -> origin/master
	  remotes/origin/master
Here, master is a branch in the local repository. remotes/origin/master is a branch named master on the remote named origin. You can refer to this as either origin/master, as in:
	git diff origin/master..master
You can also refer to it as remotes/origin/master:

git diff remotes/origin/master..master

What is Kubernetes

* Kubernetes is an open-source container orchestrator
* K8s helps with:
	* Cluster Management of machines (perform health checks, bounce them, change cluster size)
	* Scheduling containers on those machines (match CPU/memory requirements with right machines).
* Defines API objects to describe your cluster’s desired state.
* Provides basic monitoring, logging, and health checking.
* Reconciles desired state and current state.
@percyvega
percyvega / DDD Cheatsheet.md
Last active September 8, 2022 22:29
DDD Cheatsheet

DDD

Message types:

  1. Command: an expression of intent to trigger an action in the domain.
    • Routing: routed to a single handler (via consistent hashing).
    • Outcome: provides confirmation/result (sync or async).
  2. Event: a notification (if subscribed) that something relevant has happened inside the domain.
    • Routing: distributed to all logical handlers (ordering required).
    • Outcome: no results from handling.
  3. Query: a request for information or state.

Concepts

Aperture

  • It's the opening in a lens through which light passes to enter the camera.
  • You can shrink or enlarge the size of the aperture to allow more or less light to reach your camera sensor.
  • It affects the depth of field.
  • It also affects the exposure of your images by making them brighter or darker.
  • e.g. aperture of f/1.4
    • wide/large aperture
  • a lot of light passing through the lens = bright image

Vert.x is a toolkit to build reactive and distributed systems.

It's a server API for writing asynchronous networking applications (e.g. for db connectivity, monitoring, authentication, service discovery, clustering, etc.)

You can use Vert.x callback-based API exclusively, but Vert.x also implements an equivalent Rxified API using RxJava under the hood. This provides a great platform to integrate Vert.x modules within RxJava applications.

Vert.x provides fluent HTTP endpoints and route configuration backed by handlers where the business logic is implemented. But the real nervous system is the event bus that acts as a telecom provider to all Vert.x local or distributed components.

Its event-bus supports:

  1. BLACK, RED are hot wires, carrying power from the service panel to the electrical device.
  2. WHITE wires are neutral, meaning they carry power back to the service panel.
  3. GREEN (or bare copper) wires are ground wires.

Ceiling Fan: Connect the tip of the ceiling COPPER wire with the tip of the GREEN ground wires (one from the fan, and another one from the fan base).

Connect all WHITE neutral wires (ceiling, receiver and fan).
@percyvega
percyvega / RegEx Cheatsheet.md
Last active October 6, 2021 01:53
RegEx Cheatsheet

https://regex101.com/

Remove all Javadocs from a file /*(?s:(?!*/).)**/

    \/ matches the character / literally (case sensitive)
    \* matches the character * literally (case sensitive)
    Non-capturing Group. Matches the tokens contained with the following effective flags: s (?s:(?!\*\/).)*
        s modifier: single line. Dot matches newline characters
  • matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)