Skip to content

Instantly share code, notes, and snippets.

View JeffMatson's full-sized avatar
💭
<Something Clever>

Jeff Matson JeffMatson

💭
<Something Clever>
View GitHub Profile
@JeffMatson
JeffMatson / get-plugins-by-name.sh
Created August 29, 2016 03:13
Shell script to get all plugins and details matching a name in the WordPress plugins repository
#!/bin/bash
echo "Name, URL, Slug"
IFS=$'\n' # make newlines the only separator
for j in `curl https://wordpress.org/plugins/search.php?page=[1-12]\&q=gravity+forms | grep '<h4>.*</h4>'`
do
echo -n "$j" | awk 'BEGIN { FS = ">" } ; { print $3 }' | awk 'BEGIN { FS = "<" } ; { print $1 }' | sed 's/\&amp\;/\&/g' | tr -d "\n"
echo -n ,
echo -n "$j" | awk 'BEGIN { FS = "\"" } ; { print $2 }' | tr -d "\n"
echo -n ,
@JeffMatson
JeffMatson / 0_reuse_code.js
Created January 3, 2017 20:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@JeffMatson
JeffMatson / gfaddon-minimum-requirements.php
Last active December 20, 2020 21:35
Gravity Forms GFAddOn->minimum_requirements() usage.
array(
// Require WordPress version 4.6.2 or higher.
'wordpress' => array(
'version' => '4.6.2'
),
// Require PHP version 5.3 or higher.
'php' => array(
'version' => '5.3',
@JeffMatson
JeffMatson / functions.php
Last active February 27, 2017 17:24
Filters the Gravity Forms entry IP.
add_filter( 'gform_ip_address', 'filter_gform_ip_address' );
function filter_gform_ip_address( $ip ) {
// Return the IP address set by the proxy.
// E.g. $_SERVER['HTTP_X_FORWARDED_FOR'] or $_SERVER['HTTP_CLIENT_IP']
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
public function feed_settings_fields() {
return array(
array(
'title' => 'PDF Settings',
'fields' => array(
array(
'label' => 'Enable PDF Download',
'type' => 'checkbox',
'name' => 'enabled',
'tooltip' => 'Check this if you want a download link to the PDF to be displayed.',
<?php
echo 'testing gist stuff';