This file contains hidden or 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; | |
use App\Services\KirbyDataReader; | |
use Illuminate\Database\Eloquent\Model; | |
use League\Flysystem\FileNotFoundException; | |
abstract class HybridModel extends Model | |
{ |
This file contains hidden or 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 define('DS', DIRECTORY_SEPARATOR); | |
// Set this one to your own blueprint root if you changed it. | |
$blueprint_root = __DIR__ . DS . 'site' . DS . 'blueprints'; | |
// For Kirby 3, see the comment below. | |
/** | |
* === Let's build an IDE-helper for Kirby for PHPStorm! | |
* |
This file contains hidden or 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 | |
header('Content-Type: application/json'); | |
class Bot { | |
const xrayUrl = ''; // host your own XRay! | |
const logfile = 'log.txt'; | |
const names = [ | |
// add names for your bot here, so it can ignore itself | |
// IMPORTANT! because it will loop and flood if you're not careful |
This file contains hidden or 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 fibo($n) { | |
if($n <= 1) return $n; | |
return fibo($n-1) + fibo($n-2); | |
} | |
function haha($n) { | |
return str_repeat('ha', fibo($n)); | |
} |
This file contains hidden or 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 Indexer { | |
static $fields; | |
static $methods; | |
static $site; | |
static function get($where = null, $num = 20, $hideDeleted = true) { | |
if (!static::$site) static::$site = site(); |
This file contains hidden or 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 | |
echo 'What pattern of consonants and vowels? '; | |
echo '(use "C" and "V" like CVC or CVCV)'.PHP_EOL; | |
$pattern = trim(fgets(STDIN), PHP_EOL); | |
$a = [ | |
'a','e','i','o','u', | |
]; |
This file contains hidden or 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 | |
// add after line 22 | |
[ | |
'pattern' => 'discover', | |
'action' => function() { | |
echo mentions::discoverEndpoint(get('url')); | |
} | |
], |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<title><?php echo $site->title()->html() ?> | <?php echo $page->title()->html() ?></title> | |
<style> | |
.field { |