Skip to content

Instantly share code, notes, and snippets.

View sholsinger's full-sized avatar

Steve Holsinger sholsinger

View GitHub Profile
@sholsinger
sholsinger / image_resize.rb
Created August 2, 2012 05:06
Quick and Dirty Image Resizing with Ruby & RMagick
#!/usr/bin/ruby
require "RMagick"
# ensure dirs are available for writing
["thumbs","full","processed"].each do |dir|
if !File.directory? dir
Dir.mkdir dir
end
end
@sholsinger
sholsinger / BusinessDayAdd.vbs
Created April 15, 2011 15:20
Visual Basic Script for doing "working day" arithmetic. Use this function to add or subtract business days from a VBScript date object.
Function BusinessDayAdd(delta, dt)
dim weeks, days, day
weeks = Fix(delta/5)
days = delta Mod 5
day = DatePart("w",dt)
If (day = 7) And days > -1 Then
If days = 0 Then
days = days - 2
@sholsinger
sholsinger / inArray.vbs
Created April 26, 2011 20:52
VBScript tool for checking if a value is in an array.
' returns the index of obj in array. obj can be anything. Returns -1 if not found.
Function inArray(arr, obj)
On Error Resume Next
Dim x: x = -1
If isArray(arr) Then
For i = 0 To UBound(arr)
If arr(i) = obj Then
x = i
Exit For
@sholsinger
sholsinger / README.md
Created February 23, 2021 04:11
Automating SFCC B2C Pricebook Site Assignment

Assigning a Pricebook to a Site Automatically

The list of pricebooks that should be active is saved in a system-level Site Preference called, SitePriceBooks. This value can be set by importing a preferences.xml file in a site import/export archive. The value of this site preference should be a colon (:) separated list of pricebook IDs. eg:

<preference preference-id="SitePriceBooks">list-prices:sale-prices</preference>

The entire file should look like the following code snippet:

@sholsinger
sholsinger / sfcc-b2c-docs-as-search-engine.md
Last active July 31, 2023 03:13
SFCC B2C Documentation as a Search Engine in your Browser

How to easily look up things in the SFCC B2C Docs from your URL bar

This guide is intended for use with Chrome, but this feature exists in several browsers. It will walk you through adding a cusom SFCC B2C search engine shortcut to your Chrome profile.

Updated 2023-07-30

Setup

Step 1 In Chrome, go to Settings > Search engine > Manage search engines (Or just navigate to: chrome://settings/searchEngines)