Skip to content

Instantly share code, notes, and snippets.

version: '3.2'
services:
logs:
image: sematext/logagent:3.0.2
environment:
- LOGS_TOKEN=
- REGION=EU
- GEOIP_ENABLED=true
- GEOIP_FIELDS=ClientHost
@iben12
iben12 / Google Mail Merge with MailChimp templates.md
Last active February 11, 2017 23:49
Use Google Mail Merge with MailChimp templates

Go to MailChimp

  1. Replicate template in MailChimp

    MailChimp templates

  2. Edit template for the campaign

    You should make it complete, not as a template. All texts, pics should be final.

    You can use tags from the Mail Merge Sheet like {{First Name}} or {{Email Address}} and it will be populated for each recipient.

Promo Simple

@iben12
iben12 / 1_Laravel_state-machine.md
Last active August 12, 2023 08:36
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.