Skip to content

Instantly share code, notes, and snippets.

View sc0ttkclark's full-sized avatar
🍕
Working hard reviewing and deploying code

Scott Kingsley Clark sc0ttkclark

🍕
Working hard reviewing and deploying code
View GitHub Profile
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active November 15, 2022 18:59
WebStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

WebStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and webstorm-toolbox.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Update the webstorm-toolbox.sh to use your username for the /Users/yourusername/ path and the correct version number (WebStorm > About > Build #WS-XXX.XXXXX.XX where XXX.XXXXX.XX is the version number to use).
  3. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/webstorm-toolbox.sh
  4. Go into Tower.app Preference > Git Config > Select "WebStorm (Toolbox)" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active March 3, 2024 09:22
PhpStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

Toolbox PhpStorm.app Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and phpstorm-toolbox.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Update the phpstorm-toolbox.sh to use your username for the /Users/yourusername/ path and the correct version number (PhpStorm > About > Build #PS-XXX.XXXXX.XX where XXX.XXXXX.XX is the version number to use).
  3. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/phpstorm-toolbox.sh
  4. Go into Tower.app Preference > Git Config > Select "PhpStorm" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active November 23, 2022 15:41
WebStorm.app (Standalone) Mac integration with Tower.app for diff and merge

WebStorm.app (Standalone) Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and webstorm.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory
  2. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/webstorm.sh
  3. Go into Tower.app Preference > Git Config > Select "WebStorm" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"

Other variations

@sc0ttkclark
sc0ttkclark / wordpress-plugins-saved-replies.user.js
Created February 9, 2022 17:06
WordPress.org plugins and themes topic saved replies Tampermonkey script. Click 'raw' to install it.
// ==UserScript==
// @name WordPress.org plugins and themes topic saved replies
// @namespace https://skc.dev/
// @version 0.1
// @description Add saved replies to topic reply forms.
// @author Scott Kingsley Clark
// @match https://wordpress.org/support/topic/*
// @match https://*.wordpress.org/support/topic/*
// @grant none
// ==/UserScript==
@sc0ttkclark
sc0ttkclark / .htaccess
Last active October 24, 2021 00:54
Handle .php files using the getfile in PMPro integration.
# Add this to your .htaccess code just like the normal getfile.php code.
# Follow instructions here first and then add the line: https://www.paidmembershipspro.com/locking-down-protecting-files-with-pmpro/
RewriteRule ^protected-directory/(.*)$ /wp-content/plugins/paid-memberships-pro/services/getfile.php [L]
@sc0ttkclark
sc0ttkclark / example-attendees-orm-01-get-attendees.php
Last active May 18, 2022 03:27
Event Tickets Attendees ORM examples
<?php
/*
* Get a list of attendees.
*/
// Set the provider. This can be default (all attendees of any type), tribe-commerce, rsvp, woo, or edd.
$provider = 'default';
// Get the ORM object set up.
@sc0ttkclark
sc0ttkclark / my-custom-pods-block-1.php
Last active December 4, 2022 10:21
Pods Blocks API examples for register a custom block type or a custom block collection. Screencast: https://share.skc.dev/12uJvZL1
<?php
/**
* Plugin Name: My Custom Pods Block
* Plugin URI: https://gist.github.com/sc0ttkclark/73930f5a4b8f093d4c0d500bdb1eca5b
* Description: Custom block built using the Pods Block PHP API. No Javascript needed!
* Author Name: Scott Kingsley Clark
* Author URI: https://skc.dev/
*/
/**
@sc0ttkclark
sc0ttkclark / skc-404.php
Last active April 14, 2021 14:45
My 404 handler for scottkclark.com
<?php
/**
* Handle 404's in a way that can trick Slack and other link previews.
*/
function skc_404_handler() {
$video_urls = [
'https://www.youtube.com/watch?v=JB3INq8n9is',
'https://www.youtube.com/watch?v=jY5Mo_7kLFE',
'https://www.youtube.com/watch?v=rbsPu1z3ugQ',
<?php
/* Sample Register Helper fields
Register Helper Add On (https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/)
Add this to your customization plugin for PMPro Customizations: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
or
@sc0ttkclark
sc0ttkclark / custom-pods-shortcode-total-text.php
Last active May 28, 2019 02:44
Custom `[pods]` shortcode handling for total text.
<?php
/*
* Ensure total_found() gets calculated right away, because in the [pods] shortcode
* it does other queries after the initial find().
*/
add_filter( 'pods_data_auto_calculate_total_found', '__return_true' );
/**
* Add custom shortcode handling for total text.