-
A database for 2022 (hn) (Tailscale uses SQLite)
-
I'm all-in on server-side SQLite (hn) (Fly.io acquires Litstream)
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 | |
/** | |
* A custom FormIt hook for CSRF Protection | |
* | |
* Usage: | |
* Append this Plugin as PreHook and Hook | |
* | |
* [[!FormIt? | |
* &preHooks=`FormItCSRF` | |
* &hooks=`spam,FormItCSRF,email` |
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 | |
// Only executable via SSH | |
if (PHP_SAPI !== 'cli') exit(); | |
// Instantiate MODX | |
@include(dirname(__FILE__) . '/config.core.php'); | |
if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/'); | |
include_once (MODX_CORE_PATH . "model/modx/modx.class.php"); | |
$modx= new modX(); | |
$modx->initialize('web'); |
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 | |
/** | |
* Add as a plugin | |
* System Event: OnHandleRequest | |
*/ | |
if (!headers_sent()) { | |
header('X-Powered-By: MODX Revolution'); | |
} |
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 | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |
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 | |
/** | |
* includeFile snippet is to include any file in MODX's page, either in resource, template, or chunk | |
* | |
* @author goldsky <[email protected]> | |
* @copyright Copyright (c) 2015, goldsky | |
* @example [[!includeFile? &file=`[[++core_path]]statics/chunks/mychunk.chunk.tpl`]] | |
* [[!includeFile? &file=`[[++core_path]]statics/snippets/mysnippet.snippet.php`]] | |
* |
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 | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |
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 | |
/* | |
* This file is part of the MODSlim package. | |
* | |
* Copyright (c) Jason Coward <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
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 | |
$eventName = $modx->event->name; | |
switch($eventName) { | |
case 'OnDocFormPrerender': | |
if (!is_object($resource)) { // prevents bad error when user doesn't have perms to resource | |
$modx->log(modX::LOG_LEVEL_ERROR, '[ContentBlocks Templates] No Resource Object on line: ' . __LINE__); | |
return; | |
} | |
// a system setting must be created with the key 'contentblocks.enabled_template_ids' | |
$enabledTemplates = array_map('trim', explode(',', $modx->getOption('contentblocks.enabled_template_ids'))); |
NewerOlder