Skip to content

Instantly share code, notes, and snippets.

@carlcs
carlcs / Module.php
Last active February 18, 2019 13:23
<?php
namespace modules;
use Craft;
class Module extends \yii\base\Module
{
/**
* Initializes the module.
@paul-frost
paul-frost / gist:2ea5c8ce57aec116ed75
Last active February 21, 2019 09:43
Responsive images in ExpressionEngine WYGWAM field
This method requires the CE Image addon.
Tell your editors to change the width/height/alignment in the image properties pop up to 300px or whatever and set the alignment if they want, but the actual size displayed on the page will be decided by you in the template code and CSS.
In the EE template:
{exp:ce_img:bulk max="500" crop="no" allow_scale_larger="no" quality="80" output='<a href="{orig}" class="embeded_image" title="{attr:title}" alt="{attr:alt}" style="{attr:style}"><img src="{made}" /></a>'}
{wygwam_field}
{/exp:ce_img:bulk}
In the CSS:
@croxton
croxton / cpanel_vps_eecms_config.md
Last active September 5, 2021 23:34
Battle-tested cPanel VPS server configuration for medium traffic ExpressionEngine websites

"Medium traffic" = able to handle around 50 concurrent users on average.

If you want to handle 100+ concurrent users with the same modest hardware see the Varnish section below.

VPS

  • 4096 MB memory
  • 125GB SSD
  • 4 CPUs
  • Cpanel