Skip to content

Instantly share code, notes, and snippets.

View callaginn's full-sized avatar
😎
Coding

Stephen Ginn callaginn

😎
Coding
View GitHub Profile
@callaginn
callaginn / sphp.sh
Created September 23, 2021 06:03
Easy Brew PHP version switching (with M1 Mac Support)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
@callaginn
callaginn / dreamhost.js
Last active November 5, 2021 05:36
Fetch and Download Dreamhost Domain Info
/*/
Fetch Dreamhost Domain Info
The Dreamhost API command domain-list_domains was retired on Nov 2nd 2021. This function is a makeshift replacement for that.
Usage:
1. Log into your Dreamhost account and click Domains / Manage Domains
2. Paste this entire gist into the console
3. Press enter and wait for "sites.json" to be downloaded
Let me know if this helps anyone else or if you have any suggestions.
@callaginn
callaginn / dreamweaver-twig-migration.md
Last active July 15, 2025 20:05
Dreamweaver to Twig Migration

1. Replace ssi include with twig include:

Find: <!--#include virtual="\/includes\/(.+).ssi" -->
Replace: {% include '$1.twig' %}

Modification of that, which supports file includes as well:

Find: <!--#include (?:virtual|file)="(.+).ssi" -->
Replace: {% include '$1.twig' %}

You can always go back later and replace the following with a blank string:

Find: (?&lt;={% include ')\/?includes\/

@callaginn
callaginn / less-scss-migration.md
Created August 7, 2023 18:33
Less to SCSS Migration

Migrate CR Border Radius

Find: @include\s*(cr-border-radius)\(([^;]+)\);
Replace: $1: $2;