CREATE TABLE products (
id INT AUTO_INCREMENT PRIMARY KEY,
name JSON NOT NULL
);
INSERT INTO products (name) VALUES('{"en": "Traffic lights", "de": "Verkehrsampel", "nl": "Stoplichten"}');
INSERT INTO products (name) VALUES('{"en": "Car", "de": "Auto", "nl": "Wagen"}');
INSERT INTO products (name) VALUES('{"en": "Bike", "de": "Fahrrad", "nl": "Fietsen"}');
INSERT INTO products (name) VALUES('{"en": "Airplane", "de": "Flugzeug", "nl": "Vliegtuig"}');
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
/** | |
* Find the amount of auto-increment "space" has been used. This may can help identify | |
* tables that are running out of available ID values. | |
*/ | |
SELECT | |
t.table_name, | |
t.column_name, | |
-- The highest possible ID that can be created with this data-type. | |
t.max_value, | |
-- The last ID created in this table. |
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 TerminationSignals extends \yii\base\Module | |
{ | |
public function init() | |
{ | |
parent::init(); | |
// Listen to SIGTERM |
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; | |
class NoFields extends \craft\services\Fields | |
{ | |
public function getAllFields($context = null): array | |
{ | |
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
<?php | |
# Run this script once a day via cron | |
# to persist apache_access.log.1.gz log in ./storage/logs/ | |
$src = '../logs/apache_access.log.1.gz'; | |
$dest_dir = './storage/logs/'; | |
$dest_prefix = 'apache_access.'; | |
$dest_file = $dest_dir . $dest_prefix . date("Y-m-d", strtotime("yesterday")).'.log.gz'; | |
$keep_max_files = 10; |
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\Console\Commands; | |
use Illuminate\Console\Command; | |
use Laravel\Passport\Passport; | |
class PassportKeysCommand extends Command | |
{ | |
const MAP = [ |
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
class EventCatcher | |
{ | |
/** | |
* @var array | |
*/ | |
protected $classConstants = []; | |
public function __invoke(yii\base\Event $event) | |
{ |
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 | |
/** | |
* Example: Oauth with Github token | |
* php make-auth-json.php github-oauth.github.com GITHUB_TOKEN | |
* | |
* Example: Basic auth for private satis repo | |
* php make-auth-json.php http-basic.nova.laravel.com NOVA_USERNAME NOVA_PASSWORD | |
*/ | |
// remove script name |
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
web/cpresources | |
├── 016a4edfe03d2d869433f50aa5c5f39f | |
│ ├── EntryDraftEditor.js | |
│ ├── EntryDraftEditor.min.js | |
│ ├── EntryDraftEditor.min.js.map | |
│ ├── EntryTypeSwitcher.js | |
│ ├── EntryTypeSwitcher.min.js | |
│ ├── EntryTypeSwitcher.min.js.map | |
│ ├── entry.css | |
│ ├── entry.css.map |
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 | |
# Exec during deployment | |
# php cloudflareWhitelistUpdate.php public/.htaccess | |
$srcUrls = [ | |
'https://www.cloudflare.com/ips-v4', | |
'https://www.cloudflare.com/ips-v6' | |
]; | |
$htacessFile = $argv[1] ?? '.htaccess'; |
NewerOlder