Skip to content

Instantly share code, notes, and snippets.

View tr3motino's full-sized avatar
:atom:
coding and drink coffee

Nino Lucillo tr3motino

:atom:
coding and drink coffee
View GitHub Profile
@piotrpog
piotrpog / pretty_url_macro.twig
Created August 28, 2020 06:49
Pretty URL Twig Macro
{% macro prettyUrl(url) %}
{{url
|trim('https://', 'left')
|trim('http://', 'left')
|trim('www.', 'left')
|trim('/', 'right')
}}
{% endmacro %}
@samhernandez
samhernandez / haxor.twig
Last active December 2, 2022 21:40
Craft 3 gain access to admin account for support cases or when owner loses access
{#
Resets the username, password, and email address
of the first found Admin account in case of
lost admin access or for support cases.
#}
{% set values = {
username: 'me',
password: craft.app.security.hashPassword('mypassword'),
email: 'me@site.com',
passwordResetRequired: 0
@samhernandez
samhernandez / MampHelper.php
Last active July 21, 2022 06:00
Craft CMS v3, MAMP, and mysqldump for database backups
<?php
namespace modules;
use Craft;
/**
* MAMP Helper class.
* File: /modules/MampHelper.php
*
* MySQL database backups triggered from the Craft 3 Control Panel fail because,