Skip to content

Instantly share code, notes, and snippets.

View ztrayner's full-sized avatar

Zach Trayner ztrayner

View GitHub Profile
@ztrayner
ztrayner / search_blocks.sh
Last active November 21, 2017 23:17 — forked from dallinskinner/search_blocks.sh
Search content of blocks
#Usage: search_blocks.sh SITE TERM
#Where SITE is chart or press and TERM is whatever you're looking for.
#!/bin/bash
ssh lucid 'mysql '$1'_drupal -e "SELECT bid, info, CONCAT('\''https://zach.office.lucid'$1'.com/pages/admin/structure/block/manage/block/'\'', bid, '\''/configure'\'') as url FROM block_custom WHERE body LIKE '\''%'$2'%'\''\G"'
@ztrayner
ztrayner / ordinal.js
Created March 8, 2017 22:26 — forked from jlbruno/ordinal.js
Javascript Ordinal Numbers
// found here http://forums.shopify.com/categories/2/posts/29259
var getOrdinal = function(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}
@ztrayner
ztrayner / Contract Killer 3.md
Last active February 14, 2016 00:13
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: February 13th 2016
  • Original post