Skip to content

Instantly share code, notes, and snippets.

View maxruby's full-sized avatar
🏠
Working from home

Maximiliano Suster maxruby

🏠
Working from home
  • Miltenyi Biotec
  • Düsseldorf, Germany
View GitHub Profile
@maxruby
maxruby / CONCURRENCY.md
Created December 6, 2021 16:16 — forked from montanaflynn/CONCURRENCY.md
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

@maxruby
maxruby / .NET6Migration.md
Created November 28, 2021 17:14 — forked from davidfowl/.NET6Migration.md
.NET 6 ASP.NET Core Migration
@maxruby
maxruby / minio_mc.sh
Created March 24, 2021 20:40 — forked from aliartiza75/minio_mc.sh
Command to use mini/mc with minio server
# Step 1 : Start minio server with non-persistent data storage policy
#
# Description: -p 9000:9000: Minio server runs on port 9000 inside the docker container, -e 9000:9000 command is exposing the internal port on
# on external port.
#
# -e "MINIO_ACCESS_KEY=access_key": It sets an envrionment variable inside container named as MINIO_ACCESS_KEY
# with the value provided by user. It will be used when a user wants to access
# minio server
#
# -e "MINIO_SECRET_KEY=access_key_secret": It sets an envrionment variable inside container named as MINIO_SECRET_KEY
@maxruby
maxruby / 1_Laravel_state-machine.md
Created August 6, 2018 20:39 — forked from iben12/1_Laravel_state-machine.md
Laravel: State-machine on Eloquent Model

Implementing State Machine On Eloquent Model*

* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.

Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.

Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.

That's the theory, let's get to the work.