Skip to content

Instantly share code, notes, and snippets.

Avatar

Laryn - CEDC.org laryn

View GitHub Profile
@laryn
laryn / default-commerce-size-color-display-snippet.php
Created Nov 3, 2017
Setting a global default size and color in Drupal Commerce product displays.
View default-commerce-size-color-display-snippet.php
/*********************************************************************************
* Setting a global default size and color in Drupal Commerce product displays.
*
* Include this in your custom module (renaming the function appropriately),
* it is not a full custom module on its own.
*********************************************************************************/
function MYMODULE_commerce_product_reference_default_delta_alter(&$delta, $products) {
$firstproduct = reset($products);
@laryn
laryn / replace_smartobject_image.js
Created Jun 17, 2017
Photoshop script to replace a smart object within a PSD with selected image(s) and save result as a JPG. (Transformations to the smart object will be applied to new images).
View replace_smartobject_image.js
// Replace SmartObject’s Content and Save as JPG
// 2017, use it at your own risk
// Via @Circle B: https://graphicdesign.stackexchange.com/questions/92796/replacing-a-smart-object-in-bulk-with-photoshops-variable-data-or-scripts/93359
// JPG code from here: https://forums.adobe.com/thread/737789
#target photoshop
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
var theName = myDocument.name.match(/(.*)\.[^\.]+$/)[1];
var thePath = myDocument.path;
You can’t perform that action at this time.