Skip to content

Instantly share code, notes, and snippets.

View dreadfullyposh's full-sized avatar

Jeremy Gimbel dreadfullyposh

View GitHub Profile
@dreadfullyposh
dreadfullyposh / automation.yaml
Created February 5, 2021 14:31
Home Assistant Single Automation for ZigBee devices that have multiple commands (e.g. buttons that support hold and double click)
alias: Aqara Button Handler
description: ''
trigger:
- platform: event
event_data:
device_ieee: '00:15:8d:00:06:36:dd:c1'
event_type: zha_event
condition: []
action:
- choose:
@dreadfullyposh
dreadfullyposh / Dockerfile
Created March 24, 2020 12:47
Example using Docker multi-stage builds
# Dev - name the stage with `as dev`
FROM confluxgroup/php-nginx:7.4 as dev
RUN add-apt-repository -y ppa:ondrej/php \
&& apt-get update -y \
&& apt-get install php7.4-sqlite3 -y \
&& rm -rf /var/lib/apt/lists/*
# Production - name the stage with `as prod`
FROM dev as prod
{
"sources": [{
"name": "Organization Logos",
"handle": "organizationLogos",
"type": "Local",
"settings": {
"path": "{fileSystemPath}uploads/organization_logos",
"url": "{siteUrl}uploads/organization_logos",
"publicURLs": true
},
@dreadfullyposh
dreadfullyposh / provision.sh
Created December 5, 2016 17:49
Provisioning script for changing the PHP version of Scotchbox
# Add the following line to your Vagrantfile:
# config.vm.provision "shell", path: "provision.sh"
#
# Create the provision.sh file inside your vagrant directory (where your Vagrantfile is located)
#
# Uncomment the appropriate line below for the PHP version you want to isntall.
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get --purge remove -y php5-*
{
"name": "confluxgroup/twigee",
"description": "Twig + EE",
"authors": [
{
"name": "Jeremy Gimbel",
"email": "[email protected]"
}
],
"require": {
@dreadfullyposh
dreadfullyposh / json.html
Created May 16, 2014 21:19
json template
{exp:http_header content_type="application/javascript"}
{
{exp:low_search:results
{if get_post:keywords}keywords="{get_post:keywords}"{/if}
{if search:sites}child:index_site="{search:sites}"{/if}
disable="member_data|categories|category_fields|pagination"
collection="index"
backspace="1"
log_search="yes"
}
@dreadfullyposh
dreadfullyposh / template.html
Created May 15, 2014 19:24
PaternitEE Conditional using Mo' Variables and IfElse
// First off, you'll want to make sure you have Mo' Variables enabled, and make sure a default value is being set for
// your field names, so things don't go crazy.
// IfElse will prevent both conditions from parsing, since this is an advanced conditional and would kill performance
{exp:ifelse parse="inward"}
{if "{get:your_query_string_param}" == ""}
{exp:channel:entries (other stuff here) }
// perhaps a snippet of your loop template to keep things try
@dreadfullyposh
dreadfullyposh / freeform_downloads.html
Last active August 29, 2015 14:01
Using FreeForm to protect downloads
// This is the form template, note the return including the form entry id
{exp:freeform:form
form_name="downloadform"
return="templategroup/downloadtemplate/%%entry_id%%"
}
// fields go here..
{/exp:freeform:form}
{exp:paternitee:entries
channel="content"
field_type="relationship"
use_get="no"
paginate="bottom"
limit="3"
disable="categories|member_data"
field:content_cats="leopard"
}
// if field_id_4 is your playa field it works like this
$this->EE->load->library('api');
$this->EE->api->instantiate('channel_entries');
$this->EE->api->instantiate('channel_fields');
$data = array(
'title' => $entry->title,
'field_id_4' => '',
'field_ft_4' => 'none',