Skip to content

Instantly share code, notes, and snippets.

View zachharkey's full-sized avatar

Zach Harkey zachharkey

  • Harkey Design
  • Deep South
View GitHub Profile
@zachharkey
zachharkey / Recursively copy a directory (using cp, tar or rsync).md
Last active April 15, 2024 19:39
Recursively copy a directory (using cp, tar or rsync). Reformatted from http://snipplr.com/view/26670/

Recursively copy a directory (using cp, tar or rsync)

Original Source: http://snipplr.com/view/26670/

Reformatted for improved readability and personal reference.

How does one make a recursive, identical copy of /source/ into /target/?

I suppose you want to do that for archiving or duplicating something and want to preserve "everything". That includes permissions, ownership, filetypes, timestamps etc.

@zachharkey
zachharkey / .bashrc
Created May 22, 2013 22:02
Cpanel .bashrc to prevent error: "stdin: is not a tty"
# .bashrc
# Prevent "stdin: is not a tty" errors
if [ $(expr index "$-" i) -eq 0 ]; then
return
fi
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@zachharkey
zachharkey / refund-policy.md
Created December 13, 2013 19:52
Refund Policy

Title: Refund Policy Comment: Methodology for administering refunds.

Refund Policy

Methodology for administering refunds.

Returns

Our policy lasts 30 days. If 30 days have gone by since your purchase, unfortunately we can’t offer you a refund or exchange.

@zachharkey
zachharkey / sqs-snippet-hide-qty.html
Last active August 3, 2021 08:43
Squarespace: This is a hack to hide the "Quantity" input field in product blocks on a per page basis. Paste this into a code block somewhere above the product block. Set code block to "HTML" and uncheck "Display Source".
<style>
/* Hide quantity fields on this page only */
.product-block .product-quantity-input { display: none; }
</style>
@zachharkey
zachharkey / README.md
Created November 28, 2012 21:28
SublimeText2 CSSTidy Custom Templates

Custom CSSTidy Templates for Sublime Text 2

The CSSTidy package for SublimeText 2 works great for toggling between different CSS formats, but none of the default options output CSS consistent with the Drupal CSS coding standards with selectors, braces and properties indented and formatted like so:

selector {
  property: value; 
}

CSSTidy allows you to add your own templates, but the documentation is sparse, then there's the matter of the Sublime Text 2 integration. If I hadn't been deeply procrastinating, I would not have had th patience to figure it all out. Here's what to do:

@zachharkey
zachharkey / example.aliases.drushrc.php
Created February 13, 2013 06:04
Example of Drush site alias configuration file
<?php
/**
* Example of valid statements for an alias file. Use this
* file as a guide to creating your own aliases.
*
* Aliases are commonly used to define short names for
* local or remote Drupal installations; however, an alias
* is really nothing more than a collection of options.
* A canonical alias named "dev" that points to a local
@zachharkey
zachharkey / shopify-custom-fields-bookmarklet.md
Last active August 22, 2018 17:39
Installing the "Custom Fields" bookmarklet for Shopify

You will need to create a custom bookmark in your browser. Name it something like "Custom Fields". Browser bookmarks usually point to a URL, but we're going to insert a script instead, so in the destination URL field, paste the following script:

javascript:(function(){var gaJs = document.createElement("script");gaJs.type = "text%2Fjavascript";gaJs.src = "https%3A%2F%2Fs3.amazonaws.com%2Ffreakdesign-us%2Fshopify%2Fcustom_fields%2Fs%2Ffreakdesign_custom_fields.min.js";document.getElementsByTagName("head")[0].appendChild(gaJs);})();

Now, when you are editing certain pages in Shopify, you can click your new "Custom Fields" bookmark and it will fire our script, which will reveal otherwise hidden custom fields.

The Caduceus Logo

The original source logo is served as a vector SVG from the following URL: http://res.cloudinary.com/caduceus/caduceus-logo.svg

We can manipulate pretty much every characteristic of this logo, e.g. filetype, width, color, etc. by changing the parameters in this URL.

Change size on the fly.

@zachharkey
zachharkey / drupal-stackexchange-126522.md
Created August 15, 2014 06:57
Debugging drush archive-dump settings.md

The Full Test Setup

I created a brand new default Drupal 7 website and I added the following additional test files which match my exclude patterns and therefore be excluded from the archive dumps:

$ cd ~/Sites/example.com/public_html  

Here is the exact alias record from ~/.drush/aliases.drushrc.php

$aliases['example.com'] = array(

'uri' => 'example.com',

@zachharkey
zachharkey / terms-of-service.md
Created October 15, 2013 14:18
Generic Terms of Service for a store website.

Title: Terms of Service Comment: General terms of business

TERMS OF SERVICE

General terms of business

OVERVIEW

This website is operated by {{business.name}}. Throughout the site, the terms “we”, “us” and “our” refer to {{business.name}}. {{business.name}} offers this website, including all information, tools and services available from this site to you, the user, conditioned upon your acceptance of all terms, conditions, policies and notices stated here.