Skip to content

Instantly share code, notes, and snippets.

View siebird's full-sized avatar

Austin Siewert siebird

View GitHub Profile
@siebird
siebird / ddev-bookmarklet.js
Last active September 14, 2023 15:27
Bookmarklet to convert current url to a DDEV url
/*
A bookmarket to convert a live URL to a DDEV URL. To install bookmarklet:
- right click in bookmark bar or go to bookmark manager to add new page in your browser
- click `add page`
- name 'DDEV URL` or whatever you want
- copy and paste the code below into the URL field. Lines 9-16.
*/
javascript:(function(){
const url = window.location.href;
@siebird
siebird / harvestInvoiceHook.user.js
Last active November 21, 2017 18:56
Userscript Harvest invoice update hook to send POST to Zapier webhook URL
// ==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 November 16, 2012 17:13
ExpressionEngine true nested URI's with Switchee, URL Helper & GW Has Children
// 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 November 8, 2012 01:19
Simple .htaccess rules for ExpressionEngine on Media Temple (dv)'s
## 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 October 3, 2012 01:40
Use case of adding {last_segment_category_url_title}
<!-- 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/
@siebird
siebird / gist:2559232
Created April 30, 2012 15:24
LG Better Meta
{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}
}