⚠️ 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
/* | |
Made by Elly Loel - https://ellyloel.com/ | |
With inspiration from: | |
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/ | |
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/ | |
- Adam Argyle - https://unpkg.com/[email protected]/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE | |
Notes: | |
- `:where()` is used to lower specificity for easy overriding. | |
*/ |
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
export default (element: HTMLElement, options: any = {}) => { | |
// if added as action on non focusable element you should add tabindex=0 attribute | |
const { | |
direction = undefined, | |
shiftMultiplier = 10, | |
bubbles = false, | |
stopKeydownPropagation = true, | |
} = options; |
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
function flattenFolderTree(folders) { | |
return folders.reduce((acc, folder) => { | |
const {children, ...rest} = folder; | |
if (!children || !children.length) { | |
return [...acc, rest]; | |
} | |
return [...acc, rest, ...flattenFolderTree(children)]; | |
}, []); |
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
<x-layout> | |
<x-section> | |
<x-tabs active="First"> | |
<x-tab name="First"> | |
First content goes here. | |
</x-tab> | |
<x-tab name="Second"> | |
Second content goes here. | |
</x-tab> |
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 | |
$spaces = [ | |
'driver' => 's3', | |
'key' => env('DO_SPACES_KEY'), | |
'secret' => env('DO_SPACES_SECRET'), | |
'endpoint' => env('DO_SPACES_ENDPOINT'), | |
'region' => env('DO_SPACES_REGION'), | |
'bucket' => env('DO_SPACES_BUCKET') | |
]; |
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 | |
// bootstrap/kirby.php | |
include dirname(__DIR__) . '/vendor/autoload.php'; | |
$kirby = new Kirby([ | |
'roots' => [ | |
'base' => $base = dirname(__DIR__), | |
'index' => $base . '/public', | |
'content' => $base . '/content', |
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
panel.plugin('lukaskleinschmidt/site', { | |
components: { | |
'k-structure-field-preview': { | |
props: { | |
value: String, | |
column: Object, | |
field: Object | |
}, | |
computed: { | |
text: function() { |
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 | |
namespace App\Traits; | |
use Illuminate\Support\Str; | |
trait HasFilters | |
{ | |
public function scopeFilter($query, $filters = []) | |
{ |
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
/* Fonte: https://gist.github.com/lucaspar/2c20754b37920217678cebb64170cb7a */ | |
/** | |
* Calcula o imposto de renda sobre o valor de rendimentos tributáveis, | |
* conforme tabela progressiva do ano tributário de 2023, seguindo a | |
* incidência mensal do imposto sobre a renda de pessoas físicas (IRPF). | |
* | |
* @params {Number} rendimentos Renda a ser tributada, em R$. | |
* @returns {Number} imposto a pagar sobre `rendimentos`, em R$. | |
**/ |
NewerOlder