Skip to content

Instantly share code, notes, and snippets.

View bnomei's full-sized avatar
💬

Bruno Meilick bnomei

💬
View GitHub Profile
@bnomei
bnomei / findDuplUuids.php
Created September 16, 2023 06:45
Kirby CMS Command to Find duplicate Uuids
<?php
use Kirby\CLI\CLI;
use Kirby\Cms\Page;
return [
'description' => 'Find duplicate Uuids',
'args' => [],
'command' => static function (CLI $cli): void {
// 1) find uuids and their pages
query($userLogin: String!) {
user(login: $userLogin) {
repositories(affiliations: [OWNER], last: 100, privacy:PUBLIC) {
edges {
node {
url
issues(states: [OPEN], last: 100) {
edges {
node {
createdAt
@bnomei
bnomei / intellisense.php
Last active March 10, 2020 16:51
Generate Field-Method intellisense hints for Kirby Models from Blueprint
<?php
// add this to 'pageMethods' in a plugin
'intellisense' => function () {
// $page->intellisense()
return implode(PHP_EOL, array_merge(['/**'], array_map(function($key) {
return " * @method \Kirby\Cms\Field {$key}()";
}, array_keys($this->blueprint()->fields())), [' */']));
},