Skip to content

Instantly share code, notes, and snippets.

View shayhurley's full-sized avatar
💭
Life is like Tetris, achievements disappear, failures stick around forever.

Shay Hurley shayhurley

💭
Life is like Tetris, achievements disappear, failures stick around forever.
View GitHub Profile
@richardW8k
richardW8k / GF_Field_Button.php
Last active August 29, 2015 14:05
Testing the GF_Field class in Gravity Forms 1.9
<?php
/**
* Plugin Name: Gravity Forms Button Field
* Last Modified: 18/08/2014
*/
if ( ! class_exists( 'GFForms' ) ) {
die();
}
@richardW8k
richardW8k / logging.php
Last active September 29, 2021 01:47
Logging statements for Gravity Forms.
<?php
add_filter( 'gform_pre_render', 'log_pre_render' );
function log_pre_render( $form ) {
GFCommon::log_debug( "log_pre_render(): \$form => " . print_r( $form, true ) );
return $form;
}
add_action( 'gform_pre_process', 'log_pre_process' );
function log_pre_process( $form ) {
@kimmobrunfeldt
kimmobrunfeldt / 0-osx-for-web-development.md
Last active July 26, 2022 13:30
Install web development tools to Mavericks (OS X 10.9)

Install web development tools to Mavericks (OS X 10.9)

Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.

I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).

These are my opinions. Read this document through and pick up the good parts to your preferences.

System preferences

@richardW8k
richardW8k / RW_Delete_Entry.php
Last active January 20, 2022 07:21
When placed in the theme functions.php file this will add a checkbox to the 'Form Options' part of the Form Settings page which when checked will cause entries to be automatically deleted at the end of the submission process.
<?php
class RW_Delete_Entry {
function __construct() {
if( ! property_exists( 'GFCommon', 'version' ) || ! version_compare( GFCommon::$version, '1.8.5.8', '>=' ) )
return;
add_filter( 'gform_tooltips', array( $this, 'add_delete_tooltip') );
add_filter( 'gform_form_settings', array( $this, 'add_delete_setting' ), 10, 2 );
add_action( 'gform_pre_form_settings_save', array( $this, 'save_delete_setting' ), 10 );
add_action( 'gform_after_submission', array( $this, 'maybe_delete_form_entry' ), 15, 2 );
@richardW8k
richardW8k / RWNotificationExtras.php
Last active September 30, 2021 21:17
Adds a new settings to Gravity Forms notifications allowing uploaded files to be attached to the notification and the notification format to be changed to text.
<?php
/**
* Plugin Name: Gravity Forms - Notification Extras
* Author: Richard Wawrzyniak
* Description: Adds new settings to Gravity Forms Notifications enabling file uploads to be attached to notifications and the notification format to be changed to text.
* Version: 1.0
*
* Last Modified: 17/10/2014
* Updated attach_file() to allow for possibility that uploads folder was changed
* Added suppot for post_image fields
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@PatrickMcDonald
PatrickMcDonald / log_commands
Last active December 25, 2015 20:59
Sublime Text: Log all commands run from key bindings and the menu to the console
' Enable
sublime.log_commands(True)
' Disable
sublime.log_commands(False)
@ijy
ijy / search-and-replace-2.xsl
Created September 15, 2013 16:56
Alternative search and replace template for XSLT 1.0.
<!--
ALTERNATIVE SEARCH & REPLACE
string: The text to be evaluated
replace: The character or string to look for in the above string
with: What to replace it with
Slightly more long winded approach if that's how you prefer to roll.
-->
<xsl:template name="string-replace">
@joesepi
joesepi / gist:6299513
Last active December 21, 2015 11:29
How to get SublimeLinter working in Sublime Text 3 (ST3)

How to get SublimeLinter working in SublimeText3 (ST3)

This shouldn't be that hard.

I have done a number of things over the last few hours to get this to work and I wasn't taking notes, so this is what I think needs to happen to install SublimeLinter in ST3

The first thing you need to do is uninstall SublimeLinter if you have it installed:

  • Assuming you have Package Controll installed, hit Cmd + Shift + P to bring up the panel and type "remove" and choose "Package Control: Remove Package" and then choose SublimeLinter from the resulting menu

Let's really make sure that all of that SublimeLinter stuff is gone:

  • Navigate to ~/Library/Application\ Support/Sublime\ Text\ 3/
@agusmu
agusmu / functions.php
Last active July 16, 2016 18:37
WooCommerce - Hide Product Category Count
add_filter( 'woocommerce_subcategory_count_html', 'prima_hide_subcategory_count' );
function prima_hide_subcategory_count() {
/* empty - no count */
}