Skip to content

Instantly share code, notes, and snippets.

View joedooley's full-sized avatar

Joe Dooley joedooley

  • Florida
  • 20:15 (UTC -05:00)
View GitHub Profile
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@zackkatz
zackkatz / gravityview-edit-entry-hide-empty-fields.php
Last active September 5, 2022 04:10
GravityView - Hide Empty Fields in Edit Entry screen
<?php
/**
* Add filters to the edit entry inputs when GravityView starts to render an entry.
*/
add_action( 'gravityview/edit-entry/render/before', function() {
// GravityView methods are run at priority 10; by running at 20, this will run after GV.
add_filter( 'gform_field_content', 'gravityview_hide_empty_fields_in_edit_entry', 20, 5 );
} );
@zackkatz
zackkatz / gravityview-redirect-after-edit-entry.php
Last active November 30, 2017 04:47
Redirect after a GravityView entry is edited if the form ID matches defined cases
<?php
/**
* Add the following code to the end of your theme's functions.php file.
*
* Make sure it's inside the ?> if ?> is at the end of the file!!!
*
*/
@kelvinmo
kelvinmo / s3link-v4.php
Created October 25, 2014 00:17
PHP code to generate a pre-signed URL to access a restricted AWS S3 object