When syncing an S3 bucket within the same AWS, you still need to attach some policies. I followed these instructions, but in case they go offline. You need the following:
{
"Id": "Policy1357935677554",
"Statement": [
/** | |
* self managing nanocomponent instance proof of concept, | |
* unfortunately we get hit with proxy node bugz... | |
* | |
* idea here is you reset SOFT_IMAGE_COUNT on choo RENDER | |
*/ | |
var html = require('choo/html') | |
var Component = require('choo/component') |
.db{display:block} | |
.dib{display:inline-block} | |
.di{display:inline} | |
.dt{display:table} | |
.dtr{display:table-row} | |
.dtc{display:table-cell} | |
.df{display:flex} | |
.dif{display:inline-flex} | |
.fl{float:left} | |
.fr{float:right} |
When syncing an S3 bucket within the same AWS, you still need to attach some policies. I followed these instructions, but in case they go offline. You need the following:
{
"Id": "Policy1357935677554",
"Statement": [
In our builds we often like to have single sentence excerpts. Over the builds I've devised a rather scary looking, but effective, excerpt generating technique:
<?php
// fancy excerpt function which tries to pull
// the first sentence. minimum character count
// is considered as well.
function trunc($phrase, $max_words) {
<?php | |
// dangerously simple PHP regular expression URL router | |
// requires a mod_rewrite like "RewriteRule . /index.php [L]" | |
function get($url, $callback) { | |
$matches = array(); | |
if (preg_match('~' . $url . '~', $_SERVER['REQUEST_URI'], $matches)) { | |
echo call_user_func_array($callback, $matches); | |
die(); | |
} |
Sometimes I find it useful to match the current url against a set of keys, maybe to grab a model or define an active state. Things like that. An approach I've been using looks a little like:
<?php
function urlpattern ($path, $patterns) {
foreach ($patterns as $pattern => $name) {
if ($pattern === '*') continue; // skip default
A layout that I tend to implement is the following:
+-------+-------+
| TITLE | |
+-------| IMG |
| T | |
| E | IMG |
| X | |
| T | IMG |
<?php | |
function str_contains ($str, $arr = []) { | |
foreach ($arr as $a) { | |
if (stripos($str, $a) !== false) return true; | |
} | |
return false; | |
} |
<?php | |
function toSuper ($int) { | |
$SUPERSCRIPTS = [ | |
'0' => '⁰', | |
'1' => '¹', | |
'2' => '²', | |
'3' => '³', | |
'4' => '⁴', | |
'5' => '⁵', |