Skip to content

Instantly share code, notes, and snippets.

View toddprouty's full-sized avatar

Todd Prouty toddprouty

View GitHub Profile

Templating in EE vs. Craft

Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.

Table of Contents

  1. Comments
  2. Conditionals
  3. Loops
@toddprouty
toddprouty / README.md
Last active August 29, 2015 14:00 — forked from zachharkey/README.md

Custom CSSTidy Templates for Sublime Text 2

The CSSTidy package for SublimeText 2 works great for toggling between different CSS formats, but none of the default options output CSS consistent with the Drupal CSS coding standards with selectors, braces and properties indented and formatted like so:

selector {
  property: value; 
}

CSSTidy allows you to add your own templates, but the documentation is sparse, then there's the matter of the Sublime Text 2 integration. If I hadn't been deeply procrastinating, I would not have had th patience to figure it all out. Here's what to do:

@toddprouty
toddprouty / set-project-perms.sh
Created September 30, 2016 03:49 — forked from khalwat/set-project-perms.sh
Properly set permissions for a Craft CMS install, including ensuring that files are all g-x. Set CHOWN_USER, CHOWN_GROUP, and BASE_DIR to whatever is appropriate, add directories that need to be writeable by the web server to DIRS[], then execute: sudo ./set-project-perms.sh PROJECT_NAME
#!/bin/bash
# Execute via: ./set-project-perms.sh PROJECT_NAME
# The paradigm is the entire project dir is owned by $CHOWN_USER with the group set to $CHOWN_GROUP
# $CHOWN_USER is an admin or user account that is used to edit files/templates, etc.
# $CHOWN_GROUP is the group of the webserver (e.g.: 'apache', 'nginx', 'httpd', etc.)
# The project dir permissions are set to 755 (-rwxr-xr-x) for directories and to 644 (-rw-r--r--) for files
# The permissions to $DIRS[] that need to be writeable are set to 775 (-rwxrwxr-x) for directories and
# 664 (-rw-rw-r--) for files. Add any assets directories, etc. as necessary.
# Change $BASE_DIR to the absolute path where your websites are stored (leaving it appended with '/$1')
@toddprouty
toddprouty / flexy-navigation.markdown
Last active August 29, 2018 20:46
Flexy navigation
@toddprouty
toddprouty / myfonts-style-linking.js
Created September 7, 2018 18:03
Modified version of MyFonts.com font loader that allows style linking (use bold and italic without specifying a font-family every time)
/**
* ────────────────────────────────────────────────────────────────────────────┐
* Modified MyFonts JavaScript font loader
*
* The JavaScript font loader that is included with MyFonts font kits forces the
* use of unique font-family names, and requires you to set font-weight and
* font-style to 'normal' globally. Anywhere you are using bold or italic, a
* bold or italic font-family will need to be referenced in your CSS. This can
* cause a few issues, including having more styles to override, and worse, if
* the font files don't load, any and all bold/italic text will just look like
@toddprouty
toddprouty / # mariadb - 2020-03-31_10-18-01.txt
Created March 31, 2020 20:45
mariadb on macOS 10.14.6 - Homebrew build logs
Homebrew build logs for mariadb on macOS 10.14.6
Build date: 2020-03-31 10:18:01
@toddprouty
toddprouty / cloudSettings
Created May 26, 2021 11:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-05-26T11:55:34.887Z","extensionVersion":"v3.4.3"}
@toddprouty
toddprouty / 2021-10-14-T1147.lighthouse.report.json
Created October 14, 2021 16:48
Syniverse Lighthouse Results: Homepage / Desktop / Local -- Initial
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4590.2 Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"benchmarkIndex": 1765.5,
"credits": {
"axe-core": "4.2.3"
}
},
@toddprouty
toddprouty / 2021-10-14-T1157.lighthouse.report.json
Created October 14, 2021 16:57
Syniverse Lighthouse Results: Homepage / Mobile / Live -- Initial
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4590.2 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"benchmarkIndex": 1364,
"credits": {
"axe-core": "4.2.3"
}
},
@toddprouty
toddprouty / 2021-10-14-T1201.lighthouse.report.json
Created October 14, 2021 17:01
Syniverse Lighthouse Results: Homepage / Desktop / Live -- Initial
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4590.2 Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"benchmarkIndex": 1857,
"credits": {
"axe-core": "4.2.3"
}
},