Skip to content

Instantly share code, notes, and snippets.

View opengeek's full-sized avatar

Jason Coward opengeek

View GitHub Profile
<?php
$tstart = microtime(true);
set_time_limit(0);
require 'config.core.php';
require MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = modX::getInstance();
$modx->initialize('mgr');
@opengeek
opengeek / InstagramAspectPadding.js
Last active March 9, 2022 19:26
Use Photoshop scripting to adjust any image that exceeds Instagram aspect ratios by padding the canvas size with white background color.
var docRef = app.activeDocument;
var currentWidth = docRef.width;
var currentHeight = docRef.height;
var aspectRatio = currentWidth / currentHeight;
var mycolor = new SolidColor();
mycolor.rgb.hexValue = "ffffff";
app.backgroundColor = mycolor;
if (aspectRatio < 0.8) {