Skip to content

Instantly share code, notes, and snippets.

Avatar

Austin Siewert siebird

View GitHub Profile
@siebird
siebird / harvestInvoiceHook.user.js
Last active Nov 21, 2017
Userscript Harvest invoice update hook to send POST to Zapier webhook URL
View harvestInvoiceHook.user.js
// ==UserScript==
// @name Harvest Invoice Hook
// @namespace https://siebird.com
// @version 0.1
// @description Harvest invoice status hook to send POST to Zapier to update Google spreadsheet row
// @include /^https:\/\/\w+\.harvestapp\.com\/invoices\/[0-9]+/
// @exclude /^https:\/\/\w+\.harvestapp\.com\/invoices\/[0-9]+\/duplicate
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
// ==/UserScript==
@siebird
siebird / gist:4089096
Created Nov 16, 2012
ExpressionEngine true nested URI's with Switchee, URL Helper & GW Has Children
View gist:4089096
// The key here is to use {all_segments} & {last_segment_category_url_title} from Litzinger's URL Helper extension.
// I fork'd it and added the {last_segment_category_url} to determine if the last segment is a cat or not.
// If {last_segment_category_url} is a category, it will parse and the case will run, if not, it defaults to single entry template
// {all_segments} variable is great b/c it's dynamically builds the rule, rather than a fixed variable="{seg_1}/{seg_2}/{seg_3}/{seg_4}"
// Controller Template.
{exp:switchee variable="{all_segments}" parse="inward"}
{case value="products"}
{embed="site/_product_cat" cat_seg="home"}
@siebird
siebird / gist:4035793
Created Nov 8, 2012
Simple .htaccess rules for ExpressionEngine on Media Temple (dv)'s
View gist:4035793
## BEGIN Expression Engine Rewrite
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]
# END Expression Engine Rewrite
@siebird
siebird / gist:3824429
Created Oct 3, 2012
Use case of adding {last_segment_category_url_title}
View gist:3824429
<!-- Using @litzinger URL Helper plugin I added a new variable:
{last_segment_category_url_title}
This parses only if the last segment is a valid category (see case 3). I need this variable b/c {segment_3} will always parse, thus the third case returns true every time.
{all_segments} is perfect for the switchee variable b/c it's dynamic rather than hard coded: {segment_1}/{segment_2}/{segment_3}/{segment_4}
ie.
/products/
View gist:2559232
{exp:lg_better_meta_pl:template
url_title="{last_segment}"
title="{if entry_title}{entry_title}{if:else}{embed:title}{/if}"
description="{entry_description}"
keywords="{entry_keywords}"
{if entry_title != ""}
hide_site_title="y"
{/if}
}
You can’t perform that action at this time.