Skip to content

Instantly share code, notes, and snippets.

David Smith spivurno

Block or report user

Report or block spivurno

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zackkatz
zackkatz / edd-run-a-sale.php
Last active Jun 19, 2019
Easily run a sale in Easy Digital Downloads. This code applies a coupon globally.
View edd-run-a-sale.php
<?php
// When not running a sale, just RETURN here. (but if you forget, no problem...)
# return;
// Pass the coupon code that you want applied as the global sale coupon
new GV_Theme_Sale( 'SOLSTICE2019' );
class GV_Theme_Sale {
@bradyvercher
bradyvercher / register-plugin-icons.php
Created Oct 4, 2017
Register icons to display on the Manage Plugins screen for plugins that aren't in the WordPress.org directory.
View register-plugin-icons.php
<?php
/**
* Register plugin icons.
*
* WordPress 4.9 introduced icons in the list table on the Manage Plugins
* screen. The icons are pulled from the W.org update API. If an icon isn't
* available, a generic plugin Dashicon is shown instead.
*
* @param array $value Plugin update data.
* @return array
@thierrypigot
thierrypigot / gravity-forms.php
Created Jul 9, 2015
Permet d'interpréter les caractères html dans le label des fields.
View gravity-forms.php
add_filter( 'gform_field_content', 'tp_subsection_field', 10, 5 );
function tp_subsection_field( $content, $field, $value, $lead_id, $form_id )
{
return htmlspecialchars_decode( $content );
}
@dbspringer
dbspringer / plugin.php
Created May 7, 2015
Front-end Media Example plugin
View plugin.php
<?php
/**
* Plugin Name: Front-end Media Example
* Plugin URI: http://derekspringer.wordpress.com
* Description: An example of adding the media loader on the front-end.
* Version: 0.1
* Author: Derek Springer
* Author URI: http://derekspringer.wordpress.com
* License: GPL-2.0+
@ssstofff
ssstofff / gist:cfc80b5d702c5d290658
Last active Aug 29, 2015
Gravity forms, replace <input type="submit> element with a <button> element
View gist:cfc80b5d702c5d290658
// credits: https://github.com/CFXd
function gf_make_submit_input_into_a_button_element($button_input, $form) {
//save attribute string to $button_match[1]
preg_match("/<input([^\/>]*)(\s\/)*>/", $button_input, $button_match);
//remove value attribute
$button_atts = str_replace("value='".$form['button']['text']."' ", "", $button_match[1]);
return '<button '.$button_atts.'>'.$form['button']['text'].'<i class="fa fa-refresh"></i></button>';
@basham
basham / css-units-best-practices.md
Last active Oct 14, 2019
CSS Units Best Practices
View css-units-best-practices.md

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@lucasstark
lucasstark / gist:6594983
Created Sep 17, 2013
Example to add meta data to woocommerce cart items
View gist:6594983
<?php
/*
* Plugin Name: Example Modify Price
*/
class Example_Modify_Price {
private static $instance;
public static function register() {
if (self::$instance == null) {
@jlong
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@potch
potch / gist_line_numbers.css
Created Sep 26, 2011
CSS to add line numbers to embedded gists
View gist_line_numbers.css
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {
You can’t perform that action at this time.