Skip to content

Instantly share code, notes, and snippets.

View hdevilbiss's full-sized avatar
🌷

Hannah hdevilbiss

🌷
  • U.S.A.
View GitHub Profile
@hdevilbiss
hdevilbiss / Mdl_HelperSubs.bas
Last active December 21, 2022 17:01
Visual Basic functions to use with Named References (under Formulas > Name Manager)
' Some custom Visual Basic functions that I like to use
' User MikeD on https://stackoverflow.com/a/37611071/12621376
' Check whether a given string is a valid name in Activeworkbook.names
Function isNamedRange(ByVal rangeName As String)
Dim n As Name
isNamedRange = False
For Each n In ActiveWorkbook.Names
If n.Name = rangeName Then
isNamedRange = True
@hdevilbiss
hdevilbiss / rsync-wp.sh
Last active July 17, 2021 19:54
Linux shell script to sync WordPress assets down from production in 2 clicks.
#!/bin/bash
# A Linux shell script to remotely sync WordPress assets down from production in only 2 clicks.
# Useful when syncing sites that use third-party themes or plugins which are not available from public repositories.
# To run this script, invoke its filename using the `bash` command. `bash rsync-wp.sh`
# DEFAULT SERVER VARS
# user=""
# port=22
# ip=12.34.567.890
@hdevilbiss
hdevilbiss / deploy.rb
Last active July 17, 2021 19:56
WordPress Capistrano deployment script
set :application, 'example.com'
set :repo_url, '[email protected]:username/repo.git'
set :username, -> {'webHostUsername'}
# Git Branch Options
# ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
set :branch, :main
# Paths
set :proj_root, -> {"/home/#{fetch(:username)}/domains/#{fetch(:application)}"}
@hdevilbiss
hdevilbiss / my-fave-shortcuts.md
Last active May 12, 2025 01:13
Collection of commands. WP CLI, Linux, Git

List of Favorite Commands

Windows cmd

Install programs on drives other than C:\. Useful when hard drives fail and programs need to be reinstalled; the old references block new installation. Also useful when the main C:\ drive is small, and the program installer does not offer the option of choosing the install location.

Source: https://knowledgebase.jam-software.com/7573

start someProgramInstaller.exe /DIR="D:\Programs\Folder\On\Another\Drive\ProgramName"
@hdevilbiss
hdevilbiss / category-list.md
Last active May 12, 2025 01:15
Hugo front matter: Loop through all categories from the front matter of a given piece of content

Looping through Hugo front matter categories

Each piece of content in Hugo should have front matter. Front matter is like post meta. It can be formatted 4 ways: JSON, YAML, TOML, or ORG.

yaml format

---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}