Skip to content

Instantly share code, notes, and snippets.

@yoannisj
yoannisj / Dockerfile
Created January 19, 2022 21:41
Configurable Craft CMS Dockerfile (Postgres)
# @see https://docs.docker.com/engine/reference/builder/
# Define build arguments available outside build stage (before first FROM instruction)
# @note value can be overriden by environment variable defined for this service in docker-compose.yml
# or by environment variables defined when running the `docker build` command
ARG PHP_VERSION=7.4
ARG ENVIRONMENT=production
ARG DATABASE_DRIVER=postgres
# Base this image on corresponding version of official mariadb image
@yoannisj
yoannisj / MyModule.php
Last active August 23, 2021 10:28
Craft auto eager load fields
<?php
namespace modules\mymodule;
use yii\base\Module;
use yii\base\Event;
use Craft;
use craft\elements\db\EntryQuery;
use craft\events\CancelableEvent;

Origin Materials – Fortrabbit Backup

If the website goes down for any reason, the automatic backups provided by Fortrabbit can be used to restore the website at a previous state. The following instructions explain how this can be done.

CAUTION: The instructions below contain precious information that can be used to access and damage the server, so make sure they are only shared with well-intended and well-informed people.

Download the latest backup

  1. Log into the fortrabbit dashboard with your own credentials
@yoannisj
yoannisj / SassyContext.css
Last active August 29, 2015 14:16
Generated by SassMeister.com.
/**
* SassyContext
* ------------
* A simple sass tool that allows you to implement a set/reset sequel.
*
* This was originally designed to keep track of the current context your mixins
* and functions are running in. Contexts can be @media settings (like `type`,
* `min-width`, `max-width`), modernizr prefixes, or anything you want really...
* Could also be used to implement "do/undo" functionality.
*