Skip to content

Instantly share code, notes, and snippets.

View gbissland's full-sized avatar

Gareth Bissland gbissland

View GitHub Profile
You are the orchestrator.
You think, design and plan architectural decision only. Write only essential technical specs and reasoning. Prefer not to write code yourself unless all executors fail.
Never assume the user's intent. Ask for clarification for ambiguous situations.
Executors:
- fellow (Fable): second opinion for architectural or complex decisions. For hardest problem only.
- mechanical (Sonnet): mechanical for fast/small redundant tasks.
- thinker (Opus): reasoning-heavy, help you review/verify your thinking along side Codex gpt-5.6-sol below.
@gbissland
gbissland / fix-wordpress-permissions.sh
Created January 28, 2019 17:13 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
/* form placeholder overrides - have to use !important or this doesn't work
--------------------------------------------- */
::-webkit-input-placeholder { /* Chrome */
color: #1E1F22 !important;
}
:-ms-input-placeholder { /* IE 10+ */
color: #1E1F22 !important;
}
::-moz-placeholder { /* Firefox 19+ */
color: #1E1F22 !important;
@gbissland
gbissland / gist:dfed453ed3cf06a57e14eed6ed398480
Created April 10, 2018 04:53 — forked from mannieschumpert/gist:8334811
Filter the submit button in Gravity Forms to change the <input type="submit> element to a <button> element. There's an example in the Gravity Forms documentation, but it lacks the proper code to show your custom button text, AND removes important attributes like the onclick that prevents multiple clicks. I was trying to solve that.
<?php
// filter the Gravity Forms button type
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
// The following line is from the Gravity Forms documentation - it doesn't include your custom button text
// return "<button class='button' id='gform_submit_button_{$form["id"]}'>'Submit'</button>";
// This includes your custom button text:
return "<button class='button' id='gform_submit_button_{$form["id"]}'>{$form['button']['text']}</button>";
}
// Oops this strips important stuff
@gbissland
gbissland / imageseo
Created April 4, 2018 07:25 — forked from bluedognz/imageseo
Automatically set the image Title, Alt-Text, Caption & Description upon upload
/* Automatically set the image Title, Alt-Text, Caption & Description upon upload
--------------------------------------------------------------------------------------*/
add_action( 'add_attachment', 'my_set_image_meta_upon_image_upload' );
function my_set_image_meta_upon_image_upload( $post_ID ) {
// Check if uploaded file is an image, else do nothing
if ( wp_attachment_is_image( $post_ID ) ) {
$my_image_title = get_post( $post_ID )->post_title;
@gbissland
gbissland / breadcrumbs.php
Created April 4, 2018 05:57 — forked from bluedognz/breadcrumbs.php
This works with Beaver Themer and Astra Theme using [my_breadcrumb] (ie: Insert the shortcode into a Themer Part to display breadcrumbs)
function my_breadcrumb() {
if ( function_exists('yoast_breadcrumb') ) {
return yoast_breadcrumb( '<p id="breadcrumbs">', '</p>', false);
}
}
add_shortcode( 'my_breadcrumb', 'my_breadcrumb' );
@gbissland
gbissland / style.css
Created December 7, 2017 19:08 — forked from pro-beaver/style.css
Change Row Background Image to Background Color for mobile devices
/**
* Change Row Background Image to Background Color for mobile devices
* assign pro-row-bg-1 class to the row
*
* @author Davinder Singh Kainth
* @link http://probeaver.com/?p=348
*
*/
@media only screen and (max-width: 768px) {
@gbissland
gbissland / wp-enqueue-gravity-forms-css.php
Created May 31, 2017 23:18 — forked from isGabe/wp-enqueue-gravity-forms-css.php
WordPress: register Gravity Forms stylsheet, only enqueue on Contact page #snippet #WordPress
// Gravity Forms style sheet
wp_register_style( 'gravity-forms', get_stylesheet_directory_uri() . '/library/css/gravity-forms.css', array(), '' );
// only load on contact page
if(is_page('contact')){
wp_enqueue_style('gravity-forms');
}
@gbissland
gbissland / Enqueue-jQuery.php
Created May 24, 2017 22:25 — forked from mzo84/Enqueue-jQuery.php
Wordpress Enqueue jQuery
// Put this PHP code into your functions.php le.
// This will load the jQuery library onto your page by inserting a link in the <head> section where you call wp_head.
if(!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/
jquery/1.3.2/jquery.min.js"), false, '1.3.2');
wp_enqueue_script('jquery');
}
@gbissland
gbissland / gist:2bd3df9aafd2cadaee07f1a86e3f2c88
Created May 4, 2017 03:21 — forked from getdave/gist:4578295
Gravity Forms - custom field validation function for checkboxes. Ensures all checkboxes have been checked.
// Replace 7 with the ID of your form and 13 with the ID of the field you want to force "all required"
// http://www.gravityhelp.com/documentation/page/Gform_field_validation
add_filter("gform_field_validation_7_13", 'validate_tcs', 10, 4);
function validate_tcs($result, $value, $form, $field) {
// Convert the checkbox input name value (returned as part of "field")
// into the "underscored" ID version which is found in the $_POST
foreach ($field['inputs'] as $input) {
$input_post_value = 'input_' . str_replace('.', '_', $input['id']);