Skip to content

Instantly share code, notes, and snippets.

Simon Prosser Pross

Block or report user

Report or block Pross

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
@Pross
Pross / denyhosts.php
Last active Dec 16, 2015
DenyHosts for wordpress
View denyhosts.php
<?php
/*
Plugin Name: DenyHosts
Plugin URI: http://pross.org.uk
Description: Block bad login attempts.
Version: 1.0
Author: Pross
*/
class DenyHosts {
View pagelines-dms-toolbar-customizer.php
<?php
/*
Plugin Name: PageLines DMS Toolbar Customizer
Author: TourKick (Clifford P)
Author URI: http://tourkick.com/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmstoolbarcustomizer
Plugin URI: http://www.pagelinestheme.com/remove-dms-editor-toolbar-items-2/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmstoolbarcustomizer
Description: Removes 'Get More Sections' link from Add To Page panel, removes Theme panel, and removes DMS panel from the DMS editor for non-Administrators (e.g. Editors). <strong>Edit the plugin's file to customize other options.</strong> May also choose to copy code directly into your DMS child theme's functions.php file instead of activating this plugin. <a href="http://www.pagelinestheme.com/dms-editor-lock-down/" target="_blank">http://www.pagelinestheme.com/dms-editor-lock-down/</a> may also be helpful.
License: GPLv2
Version: 1.1.20131105
*/
@Pross
Pross / user.js
Last active Aug 16, 2018
Adds a dropdown to WordPress.org post reply with scripted replies.
View user.js
// ==UserScript==
// @name WordPress.org Scripted Replies
// @description Scripted Replies
// @grant none
// @updateURL https://gist.github.com/Pross/92e20d3e42da67adb57a44f7102543e2/raw/user.js
// @downloadURL https://gist.github.com/Pross/92e20d3e42da67adb57a44f7102543e2/raw/user.js
// @include https://*.wordpress.org/support/topic/*
// @include https://*.wordpress.org/support/view/*
// @include https://wordpress.org/support/topic/*
// @include https://wordpress.org/support/view/*
@markjaquith
markjaquith / activate-deactivate-uninstall-example.php
Created Mar 6, 2011
Example code for doing activate/deactivate/uninstall hooks in a WordPress plugin
View activate-deactivate-uninstall-example.php
<?php
// Change /*CUSTOMIZE_THIS*/ to a unique name (two places). Go ahead, make it long.
// Like, your initials, and your full plugin name.
// e.g. MTJ_Some_Awesome_Plugin_Controller
/*CUSTOMIZE_THIS*/_Controller::init();
class /*CUSTOMIZE_THIS*/_Controller {
function init() {
@markjaquith
markjaquith / .all
Last active Oct 10, 2018
Bash stuff
View .all
for f in ~/Dropbox/bash/*; do source $f; done
@mikejolley
mikejolley / ipn-test.php
Last active Jan 2, 2019
Quick snippet/plugin/dropin to test IPN support
View ipn-test.php
<?php
/**
* Plugin Name: PayPal Sandbox IPN Tester
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin.
* Version: 1.0.0
* Author: WooThemes
* Requires at least: 4.1
* Tested up to: 4.3
*/
if ( ! defined( 'ABSPATH' ) ) {
@Pross
Pross / functions.php
Created Jul 17, 2018
Font Awesome Five.
View functions.php
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_style( 'font-awesome-5' );
} );
@Pross
Pross / js.js
Created Jan 21, 2019
How to paste random jQuery from the internet.
View js.js
(function($){
$(document).ready(function(){
// This runs on ready function
// Add Copy+Pasta here
});
})(jQuery);
@JeremyEnglert
JeremyEnglert / beaver.php
Last active Oct 2, 2019
Set BeaverBuilder as Default Editor
View beaver.php
<?php
// Sets Beaver Builder as the default editor.
function make_beaver_builder_default( $post_ID, $post, $update ) {
if ( ! $update ) {
update_post_meta( $post_ID, '_fl_builder_enabled', true );
}
}
add_action( 'wp_insert_post', 'make_beaver_builder_default', 10, 3 );
View jquery.paste_image_reader.js
// Created by STRd6
// MIT License
// jquery.paste_image_reader.js
(function($) {
var defaults;
$.event.fix = (function(originalFix) {
return function(event) {
event = originalFix.apply(this, arguments);
if (event.type.indexOf('copy') === 0 || event.type.indexOf('paste') === 0) {
event.clipboardData = event.originalEvent.clipboardData;
You can’t perform that action at this time.