See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
<?php | |
define('MODX_API_MODE', true); | |
// Full path to the index | |
require_once('index.php'); | |
$modx = new modX(); | |
$modx->initialize('mgr'); | |
######################## Variables |
<IfModule mod_headers.c> | |
Header set Strict-Transport-Security "max-age=0; includeSubDomains; preload" env=HTTPS | |
</IfModule> |
<?php | |
/** | |
* Downloads the .woff2 formats of the specified Google Font for the specified | |
* language types. This also creates the appropriate CSS for the downloaded | |
* font files | |
* | |
* Usage: | |
* php google-font-download.php 'Open Sans' ['latin-ext,latin' [/path/to/write/to]] | |
*/ |
function Main() { | |
var template = DriveApp.getFileById('YOUR_SPREADSHEET_ID'); //template spreadsheet | |
var destination = DriveApp.getFolderById('COPY_DESTINATION_FOLDER_ID'); //the directory to copy the file into | |
var curDate = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "yyyy-MM-dd"); | |
var copyName = template.getName() + ' copy ' + curDate; //the filename that should be applied to the new copy (e.g. "My spreadsheet copy 2019-08-24") | |
copyTemplate(template, copyName, destination); | |
} | |
/** |
<?php | |
// [[pingX? &url=`www.google.com` &offline=`site down`]] | |
$url = $modx->getOption('url', $scriptProperties, ''); | |
$offline = $modx->getOption('offline', $scriptProperties, ''); | |
$timeout = $modx->getOption('timeout', $scriptProperties, '30'); | |
$port = $modx->getOption('port', $scriptProperties, '80'); | |
if (!$socket = @fsockopen($url, $port, $errno, $errstr, $timeout)) { | |
// Offline | |
$result = $offline; |
# switch ArticlesContainer -> CollectionContainer | |
# the res. ID I want to migrate is 11 | |
UPDATE `modx_site_content` SET `class_key` = replace(class_key, 'ArticlesContainer', 'CollectionContainer') WHERE id=11; | |
# switch class_key to go back to default document view for children | |
UPDATE `modx_site_content` SET `class_key` = replace(class_key, 'Article', 'modDocument') WHERE parent=11; | |
# Change template 49 -> 57 |
<?php | |
/** | |
* Based on @garryn Garry Nutting's amazingly fast sitemap generator: | |
* http://www.modx360.com/blog/2013/09/03/google-sitemap-thousands-of-resources/ | |
* | |
* Modified by @sepiariver for multi-context support | |
* GPL, no warranties, etc. | |
* | |
*/ |
<?php | |
/* | |
* getTVInputsFromJson | |
* @author @sepiariver <[email protected]> | |
* | |
* Example usage: | |
* 1. Create a Chunk with this Snippet call: [[getTVInputsFromJson? &jsonFile=`http://schema.org/docs/tree.jsonld`]] | |
* 2. Create a Single-Select TV with @CHUNK binding for "Input Options": @CHUNK my_schema_tv_chunk | |
* 3. Resources with the TV enabled will get a list of schema.org itemtype property values, like this screenshot: http://sepiariver.co/1KUr4LJ | |
* |