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 | |
/** | |
* jsonToPlaceholders snippet for JM Customer Database extra | |
* | |
* Copyright 2013 by JM Addington [email protected] | |
* Created on 04-28-2013 | |
* | |
* @package jmc | |
*/ |
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 | |
/** | |
* Found at: Controllers/Box.php | |
* | |
* Handle requests to [URL]/Controllers/Box. Automagically handles CRUD (GET/POST/PUT/DELETE) for the xPDOObject class myBox. | |
*/ | |
class MyControllerAuth extends modRestController { | |
public $classKey = 'modUser'; | |
public $defaultSortField = 'id'; |
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
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
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
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); | |
} | |
/** |
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
<IfModule mod_headers.c> | |
Header set Strict-Transport-Security "max-age=0; includeSubDomains; preload" env=HTTPS | |
</IfModule> |
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 | |
/** | |
* JSMin.php - modified PHP implementation of Douglas Crockford's JSMin. | |
* | |
* <code> | |
* $minifiedJs = JSMin::minify($js); | |
* </code> | |
* | |
* This is a modified port of jsmin.c. Improvements: | |
* |
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 | |
/** | |
* Content Blocks cbContentEditor Plugin | |
* | |
* This plugin hides certain CB buttons from certain MODX user groups | |
* and disables the drag and drop functionality, so that you can provide | |
* some clients with a more locked down version of CB. | |
* | |
* I would suggest setting up CB templates and defaults in the CB component manager, | |
* so that predefined layouts are loaded automatically when a new resource is created. |
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 | |
switch ($modx->event->name) { | |
case 'OnBeforeManagerPageInit': | |
$modx->controller->addHtml(' | |
<script> | |
// This should be a component that registers late | |
Ext.ComponentMgr.onAvailable("emptifier", function(){ | |
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 | |
/** | |
* LanguageMatch | |
* | |
* Based on https://gist.github.com/christianseel/504302ce8ddfcde009c0 | |
* Original code by http://stackoverflow.com/a/3771447 | |
* | |
* Updated by Indigo74 & x-vance for prefix/suffix and default context | |
*/ | |
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 | |
define('MODX_API_MODE', true); | |
// Full path to the index | |
require_once('index.php'); | |
$modx = new modX(); | |
$modx->initialize('mgr'); | |
######################## Variables |
NewerOlder