Skip to content

Instantly share code, notes, and snippets.

View KeyboardCowboy's full-sized avatar

Chris Albrecht KeyboardCowboy

  • Lullabot
  • Golden, CO
View GitHub Profile
@KeyboardCowboy
KeyboardCowboy / crontab
Created February 20, 2017 00:14
Have Your Mac Tell You Inspirational Quotes
# Say a quote every hour on the half hour.
30 * * * * /path/to/quotes.sh
@KeyboardCowboy
KeyboardCowboy / gitco.sh
Last active February 28, 2017 19:41
Shortcut to checkout a feature branch from a ticket number.
#!/usr/bin/env bash
#
# Shortcut to checkout a feature branch from a ticket number.
KEY=-1
SEARCH=$1
# Require a parameter.
if [[ -z "$SEARCH" ]]; then
echo "What are you searching for?"
@KeyboardCowboy
KeyboardCowboy / MYMODULE.module
Created May 10, 2017 17:03
Debug EntityFieldQueries in Drupal 7
<?php
/**
* Implements hook_query_TAG_alter().
*
* Add the tag 'debug' to any EFQ and this will print the query to the messages.
*
* @param \QueryAlterableInterface $query
*/
function MYMODULE_query_debug_alter(QueryAlterableInterface $query) {
@KeyboardCowboy
KeyboardCowboy / format-date.js
Last active December 9, 2025 16:29
Squarespace Date Formatter
/**
* ============================================================================
* SQUARESPACE DATE FORMATTER
* ============================================================================
* Reformats date strings in Squarespace with custom styling and semantic HTML
*
* This script finds date elements on your Squarespace site, parses their text
* content, and replaces them with a custom format. Each date component (day,
* month, year, weekday) gets wrapped in a span with a semantic class name
* for easy CSS targeting.