A Pen by Denis Gusev on CodePen.
This file contains hidden or 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
// From: https://csswizardry.com/2020/05/the-fastest-google-fonts/ | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link rel="preload" as="style" href="$CSS&display=swap"> | |
<link rel="stylesheet" href="$CSS&display=swap" media="print" onload="this.media='all'"> | |
<noscript> | |
<link rel="stylesheet" href="$CSS&display=swap"> | |
</noscript> |
This file contains hidden or 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
// From Kreativan's gist: https://gist.github.com/kreativan/bddcfa1c923f563d968ff40f2fb4e32e | |
<?php | |
//----------------------------------------------------------------------- | |
// Add rel="next" and rel="prev" tags for pagination in head section | |
//----------------------------------------------------------------------- | |
$wire->addHookAfter('Page::render', function(HookEvent $event) { | |
$page = $event->object; | |
if($page->template == 'admin') return; |
This file contains hidden or 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
// From Kreativan's gist: https://gist.github.com/kreativan/0ea5ea16dce287c324b5494a57c20286 | |
/** | |
* Need to include google maps api with initMap callback | |
* @function initMap | |
* | |
*/ | |
function initMap() { | |
This file contains hidden or 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
// From Kreativan's gist: https://gist.github.com/kreativan/4f58bf3a8f35cc307ef2effe3a27086d | |
<?php | |
// logout | |
if($input->get->logout) { | |
$session->logout(); | |
$session->redirect($page->url); | |
} | |
This file contains hidden or 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
// From Kreativan's gist: https://gist.github.com/kreativan/85c697b18b286a9cc0be70e35acb0a9d | |
<?php | |
// Find Pages by date | |
$year = date('Y'); | |
$month = date("F"); | |
$startTime = strtotime("1 $month $year"); | |
$endTime = strtotime("next month", $startTime); |
This file contains hidden or 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
// Place in site/modules/InputfieldCKEditor/config.js in Processwire to disallow inline styles. | |
CKEDITOR.editorConfig = function( config ) { | |
config.disallowedContent = '*{*}'; // All styles disallowed | |
}; |
This file contains hidden or 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
RewriteEngine on | |
RewriteCond %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^(.*)$ [NC] | |
RewriteRule (.*) https://www.example.com/$1 [R=301,L] |
This file contains hidden or 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
<link rel="dns-prefetch" href="//fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> | |
<link href="https://fonts.googleapis.com/css?family=Roboto|Open+Sans:400,400i,600&display=swap" rel="stylesheet"> | |
# Host Google fonts locally: | |
https://google-webfonts-helper.herokuapp.com/fonts |
This file contains hidden or 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 | |
// 1. We generate a static image from Mapbox's static Maps API. | |
// 2. We save it to an image field | |
// 3. We rename it to a more comprehensible filename, and then we add an extension (png by default for Mapbox). | |
// View investigacioncontemporanea.com -> "university" template for example of implementation. | |
if (!$page->image) { | |
$p = $page; | |
$p->of(false); |
NewerOlder