Skip to content

Instantly share code, notes, and snippets.

Brian Litzinger litzinger

Block or report user

Report or block litzinger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
litzinger / .phpstorm.meta.php
Last active Feb 16, 2020
PhpStorm meta file for ExpressionEngine
View .phpstorm.meta.php
* ExpressionEngine PhpStorm Meta
* This file is not a CODE, it makes no sense and won't run or validate
* Its AST serves PhpStorm IDE as DATA source to make advanced type inference decisions.
* @see
View Static rules
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/system [NC]
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{DOCUMENT_ROOT}/static/default_site/static%{REQUEST_URI}/index\.php -f
RewriteRule ^ /static/default_site/static%{REQUEST_URI}/index\.php [L,QSA]
litzinger / FieldAbstract.php
Created Aug 2, 2019
ExpressionEngine fieldtype abstract and interface for simplifying building fieldtypes
View FieldAbstract.php
abstract class FieldAbstract extends EE_Fieldtype
* The settings from the db that EE passes to the ft file
* @var array
public $settings = [];
litzinger / DateTime.php
Created Jun 5, 2019
Crude attempt at supporting Elasticsearch date math values in PHP's DateTime object
View DateTime.php
namespace MyNamespace;
* @author Ton Sharp
* @author Brian Litzinger
* @see
* @see
litzinger / index.js
Last active Jul 20, 2019
Simple Puppeteer screenshot script
View index.js
If saving AWS creds locally they need to be in ~/.aws/credentials
aws_access_key_id = foo
aws_secret_access_key = bar
const puppeteer = require('puppeteer');
const AWS = require('aws-sdk');
litzinger /
Last active Dec 19, 2019
ExpressionEngine Quick Tips

Forcing a database update

If you're in a situation where you've already updated EE, but then need to run the database upgrades again, this will help force the installer to run the updates again. This situation may occur if you've upgrade a local or dev version of a site, but need to grab a newer version of the production database to get it up-to-date too.

  1. Change $config['app_version'] to the previous version you've already upgraded from.

  2. Add define('INSTALL_MODE', TRUE); to your admin.php file, then reload admin.php. Clicking the version number in the footer should show an update is available, even though it may match what says is currently installed. Run the update normally, then remove define('INSTALL_MODE', TRUE); from your admin.php file.

litzinger / grid.css
Created Sep 19, 2018
Simple CSS Grid layout without a framework
View grid.css
.container {
padding: 0 1rem;
margin: 0 auto;
@media screen and (min-width: 992px) {
.container {
max-width: 1140px;
.grid-wrapper {
display: grid;
View gist:7719412e728bb0f7579b6dcaad1d3d91
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
// Set the IDEKEY in the browser Xdebug Helper extension to "vscode"
"version": "0.2.0",
"configurations": [
litzinger / hook.php
Created Oct 31, 2017
Publisher hook example
View hook.php
$query = $this->query->modify(
' AND ae.publisher_lang_id = '. $publisher_lang_id .' AND ae.publisher_status = "'. $publisher_status .'" ORDER BY',
// Publisher is disabled, but we still need to get default rows,
// otherwise it'll show duplicate rows.
litzinger / relationship-entry_ids.diff
Created Jul 24, 2017
{relationship_field:entry_ids} is not available in EE2, but is in EE3. Take the code from EE3 and put it into EE2.
View relationship-entry_ids.diff
.../expressionengine/libraries/relationship_parser/Parser.php | 10 ++++++++++
.../libraries/relationship_parser/Tree_builder.php | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git system/expressionengine/libraries/relationship_parser/Parser.php system/expressionengine/libraries/relationship_parser/Parser.php
index 6a7d61d21..3cb6bdeed 100644
--- system/expressionengine/libraries/relationship_parser/Parser.php
+++ system/expressionengine/libraries/relationship_parser/Parser.php
@@ -188,6 +188,16 @@ class EE_Relationship_data_parser {
You can’t perform that action at this time.