docker stop $(docker ps -qa) && docker rm $(docker ps -qa) && docker rmi -f $(docker images -qa) && docker volume rm $(docker volume ls -q) && docker network rm $(docker network ls -q)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Garnish.on(Craft.BaseElementIndex, 'updateElements', (ev) => { | |
// ev.target = the element index | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# based on Postmark Transactional Email Templates | |
https://postmarkapp.com/transactional-email-templates #} | |
{# If you change button color, remember to pass it to macro AND define "buttonColor" before "extends" tag. #} | |
{# macro title #} | |
{% macro title(titleText) %} | |
{% if titleText is defined %} | |
<h1 style="margin-top: 0; color: #333333; font-size: 22px; font-weight: bold; text-align: center;" align="left">{{titleText}}</h1> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const debounce = (delay, fn) => { | |
let inDebounce = null; | |
return args => { | |
clearTimeout(inDebounce); | |
inDebounce = setTimeout(() => fn(args), delay); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seven different types of CSS attribute selectors | |
// This attribute exists on the element | |
[value] | |
// This attribute has a specific value of cool | |
[value='cool'] | |
// This attribute value contains the word cool somewhere in it | |
[value*='cool'] |
- Open the console https://console.cloud.google.com
- If you haven't already, setup your Cloud billing account
- From the drop down at the top of the screen, create new project for your client, e.g.
my-client
- Make a note of the
Project number
on the project Home screen (Craft refers to this as theProject ID
) - In the sidebar go to APIs & Services > Credentials, click the
+ Create credentials
button and choose theService Account
type
- Set account name to
craft-cms
or similar - Set role to
Owner
- Save
- Click on the newly created service account email to edit it, then click the
Keys
tab and clickAdd key
>Create new key
and select theJSON
format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Yii Application Config | |
* | |
* Edit this file at your own risk! | |
* | |
* The array returned by this file will get merged with | |
* vendor/craftcms/cms/src/config/app/main.php and [web|console].php, when | |
* Craft's bootstrap script is defining the configuration for the entire | |
* application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# v2 #} | |
{% if pagination_list is defined %} | |
{% js %} | |
// AJAX REQUEST DATA | |
{% set current_url = craft.request.getRequestUri()|split(craft.request.getPath())[0]~craft.request.getPath() %} | |
{% set ajax_data = { | |
current_url: current_url, | |
pagination_list: pagination_list|hash, | |
pagination_parameters: pagination_parameters ?? null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expertise channel settings: | |
Entry URI Format: expertise/{category.inReverse().one().uri}/{slug} | |
Category group settings: | |
Category URI Format: {parent.uri}/{slug} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# | Cleaning URLs | | |
# ---------------------------------------------------------------------- | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Remove www from URL's | |
RewriteCond %{HTTP_HOST} ^www\.(.+) | |
# RewriteCond %{HTTPS}s/%1 ^(on(s)|offs)/(.+) | |
RewriteRule ^ http%2://%3%{REQUEST_URI} [L,R=301] |
NewerOlder