Skip to content

Instantly share code, notes, and snippets.

@getdave
getdave / tamper-monkey-expand-github-pr-comments.js
Last active March 17, 2022 11:40
A Tampermonkey script to automatically expand all those pesky folded Github PR comments.
// ==UserScript==
// @name Recursively expand Github PR comments
// @namespace http://aheadcreative.co.uk/
// @version 1.0
// @description Automatically expands all those pesky folded Github PR comments.
// @author Dave Smith (@getdave). Please contact for questions and feedback
// @match https://github.com/*/*/pull/*
// @copyright 2020, Ahead Creative
// @updateURL https://gist.githubusercontent.com/getdave/9b9087055decf6f6cb7bfada08fcd3d1/raw/
// ==/UserScript==
<?php
/**
* Plugin Name: YOUR PLUGIN NAME
*/
include( dirname( __FILE__ ) . '/lib/requirements-check.php' );
$your_plugin_requirements_check = new YOUR_PREFIX_Requirements_Check( array(
'title' => 'YOUR PLUGIN NAME',
'php' => '5.4',
@itod
itod / split_keyboards.md
Last active March 23, 2024 21:00
Every "split" mechanical keyboard currently being sold that I know of
@gschoppe
gschoppe / WP_Persistent_Notices.php
Last active October 16, 2022 16:46 — forked from obenland/gist:5173811
Implements a standardized messaging system that allows admin notices to be passed across page redirects. usage: add_filter( 'wp_persistent_notices', function( $notices ) { $notices[] = array( 'type' => 'error', 'message' => "Houston, we have a problem!" ); return $notices; } );
<?php if( !defined( 'ABSPATH' ) ) { die(); } // Include in all php files, to prevent direct execution
/**
* Class Name : WP Persistent Notices
* Description : Implements a Standardized messaging system that allows admin messages to be passed across page redirects.
* Class URI : http://gschoppe.com/wordpress/pass-wordpress-admin-notices-across-page-redirects/
* Version : 1.0.0
* Author : Greg Schoppe
* Author URI : http://gschoppe.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@tomysmile
tomysmile / memcached_macosx.md
Created April 26, 2016 13:27
Installing memcached on Mac with Homebrew and Lunchy

Installing memcached on Mac with Homebrew and Lunchy

This is a quick guide for installing memcached on a Mac with Homebrew, and starting and stopping it with Lunchy. I hope this tutorial will get your memcached up and running in no time.

Step 1 — Install Homebrew

Installing Homebrew is super easy. Just paste this in your terminal —

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@bradyvercher
bradyvercher / helpscout-rest-controller.php
Created March 10, 2016 21:00
A starter WP REST API controller for creating a Dynamic App for Help Scout. http://developer.helpscout.net/custom-apps/dynamic/
<?php
/**
* Help Scout REST controller class.
*
* @license GPL-2.0+
* @link http://developer.helpscout.net/custom-apps/dynamic/
*/
class HelpScout_REST_Controller {
/**
* Secret key.
@joshlevinson
joshlevinson / .bash_profile
Last active April 21, 2023 12:04
WP CLI + Xdebug
# Add this to /config/bash_profile
function wpd {
export XDEBUG_CONFIG="idekey=VVVDEBUG remote_connect_back=1"
wp "$@"
unset XDEBUG_CONFIG
};
# Run these commands:
# vagrant ssh
# sudo cp /srv/config/bash_profile /home/vagrant/.bash_profile
# source ~/.bash_profile
@devinsays
devinsays / customizer-controls-40
Last active April 20, 2023 10:03
WordPress 4.0 Customizer Controls
function prefix_customizer_register( $wp_customize ) {
$wp_customize->add_panel( 'panel_id', array(
'priority' => 10,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Example Panel', 'textdomain' ),
'description' => __( 'Description of what this panel does.', 'textdomain' ),
) );
@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by t.broyer@ltgt.net - fixes diffs that introduce new files
# modified by m@rkj.me - fix sed syntax issue in OS X
#
# Generate an SVN-compatible diff against the tip of the tracking branch