As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
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
Collections.renderer.imageplus = function(value, metaData, record, rowIndex, colIndex, store) { | |
if (value != '' && value != null) { | |
var data = Ext.decode(value); | |
var url = MODx.config.connectors_url + 'system/phpthumb.php?imageplus=1'; | |
var params = {}; | |
params.src = MODx.config['collections.renderer_image_path'] + data.sourceImg.src; | |
params.w = 100; | |
if (data.sourceImg.src.indexOf('.png') !== -1) { | |
params.f = 'png'; |
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
#!/bin/bash | |
# Root Check | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
apt-get install -qq expect |
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 OrderDeskApiClient | |
{ | |
private $store_id; | |
private $api_key; | |
private $base_url = "https://app.orderdesk.me/api/v2"; | |
public $last_status_code = ""; | |
public function __construct($store_id, $api_key) { |
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
01-autoResizeOnUpload.php - Plugin to automatically resize images uploaded via MODX that are larger than the dimensions specified | |
in the config within the plugin code. This should be considered experimental but has been tested | |
successfully on MODX Revolution 2.3.2-pl (traditional) running on Windows Server 2008. | |
02-set-expires-headers.php - Sets expires headers to value defined in plugin |
MODx Revolution lacks a preview of unsaved changes. For editors this is a rather important feature to check if their changes are correctly displayed and it's easy to do. No need to unpublish, save and view the resource. Just click 'Preview' and a MODx Window will show you all the changes.
The way it works is pretty easy: When clicking the 'Preview' button and OnBeforeDocFormSave
is triggered all current (saved) data will be stored in a cache file, the resource will be saved with the new data. If OnWebPageComplete
is fired, the saved data will be replaced with the previously cached data.
So for a short period the actual preview will be live!
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
// ---- | |
// libsass (v3.5.0.beta.2) | |
// ---- | |
// config/_breakpoints.scss | |
$breakpoints: ( | |
small: 480px, | |
medium: 720px, | |
large: 960px, | |
x-large: 1280px |
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 | |
if ($modx->getOption('http_host') == 'YOUR_DOMAIN_HERE') { | |
$op = '<script type="text/javascript"> | |
Ext.onReady(function() { | |
document.getElementById("modx-login-username").value = "USER"; | |
document.getElementById("modx-login-password").value = "PASS"; | |
document.getElementById("modx-login-btn").click(); | |
}); | |
</script>'; |