⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
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
# Only use spaces to indent your .yml configuration. | |
# $SSH_USER $ROOT_PATH $SSH_IP:$SSH_PATH are environment variables | |
# image | |
image: node:latest | |
# pipelines | |
pipelines: | |
default: | |
- step: |
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 declare(strict_types=1); | |
// In reaction to @marcoshuttle's http://marcosh.github.io/post/2017/06/16/maybe-in-php.html | |
// Warning: none of this code has been tested or even run. | |
namespace Verraes\Maybe; | |
interface Just extends Maybe { | |
// We can only extract if we know it's a Just |
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 | |
/** | |
* @author Quentin Delcourt <[email protected]> | |
* @date 2017-06-21 | |
* | |
* This script will take a folder path in argument and will extract | |
* all translatable strings from the Craft templates encountered | |
* in the given folder. Each one of these will be | |
* outputted to stdOut in CSV 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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
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 handlers = Symbol('handlers'); | |
// adapts a handler class to a common interface | |
// (technically this one isn't required - the handler class already implements the same interface) | |
class ClassDispatchable { | |
constructor(theClass) { | |
this.theClass = theClass; | |
} | |
handle(command) { | |
return (new this.theClass).handle(command); |
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
{!-- List last 3 news (blocking the <li></li> together is mandatory due to using inline-block) --} | |
{exp:channel:entries channel="news" disable="categories|category_fields|member_data|pagination|trackbacks" status="open" orderby="date" sort="desc" dynamic="no" limit="3"} | |
{if count == 1}<ul><li>{/if} | |
<article> | |
<h3><a href="{url_title_path='news-press/index'}">{title}</a></h3> | |
<p>{exp:eehive_hacksaw words="30" append="…"}{cf_news_summary}{/exp:eehive_hacksaw}</p> | |
</article> | |
{if count == total_results}</li></ul>{if:else}</li><li>{/if} |