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 | |
class UserBehavior exends \yii\base\Behavior | |
{ | |
public bool $myDynamicallyAddedProp = false; | |
} | |
$user = new \yii\web\User(); | |
$user->attachBehavior('myUser', UserBehavior::class); | |
// I want to have $user be aware of myDynamicallyAddedProp, without having to "@var User|UserBehavior". |
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 | |
use craft\helpers\App; | |
use craft\log\Dispatcher; | |
use craft\log\MonologTarget; | |
use Illuminate\Support\Collection; | |
use Monolog\Formatter\LineFormatter; | |
use Psr\Log\LogLevel; | |
use yii\i18n\PhpMessageSource; | |
use yii\web\HttpException; |
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
if (!getenv('FS_HANDLE') && !getenv('S3_BUCKET')) { | |
putenv('FS_HANDLE=imagesLocal'); | |
$_ENV['FS_HANDLE'] = 'imagesLocal'; | |
$_SERVER['FS_HANDLE'] = 'imagesLocal'; | |
// No FS_HANDLE key | |
// getenv(); | |
// 👍 | |
// getenv('FS_HANDLE'); |
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
';!*i|znnny}}T?<*=;'` | |
~;=}whhEhEEmEXmaS5SSwmamhwaSt?!, | |
;TjShSwSow5yawyjj55fj}jjoSySSawmmSSSSjs*:` | |
.?zzjfyyyjfjjyj}jututsjyu7tfjyjjjyaaoamShEUUEkS7!` | |
,zztz7z7ztzz7c777zzsI7Tc\\i7zcczInIuuIoyjyaowSmhkhk5u=, | |
.^zzuzLiL???*??*>?**?*>L**<*?*?*?LcTTiiLLTzssusnjSSoyymhS5yc;` |
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
#!/usr/bin/env zsh | |
# Start configuration added by Zim install {{{ | |
# ------- | |
# Modules | |
# ------- | |
# Sets sane Zsh built-in environment options. | |
zmodule environment | |
# Provides handy git aliases and functions. |
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
#!/bin/bash | |
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@ |
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 modules\appmodule\controllers; | |
use Craft; | |
use craft\elements\Asset; | |
use craft\web\Controller; | |
use spicyweb\embeddedassets\Plugin as EmbeddedAssets; | |
use yii\web\Response; |
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 | |
function extractCssFiles(array $manifest, string $manifestKey): array | |
{ | |
$entry = $manifest[$manifestKey] ?? null; | |
if (!$entry) { | |
return []; | |
} |
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
$filteredBody = array_filter(Craft::$app->getRequest()->getBodyParams()); | |
Craft::$app->getRequest()->setBodyParams($filteredBody); |
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
# Allow caching for anything but private | |
if (!beresp.http.cache-control ~ "(?i)private") { | |
unset beresp.http.set-cookie; | |
} |